diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-01-02 04:40:33 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-01-04 16:17:02 +0300 |
commit | 66755c9ed506af9f51022a678ed26e5d31ee87ac (patch) | |
tree | ae453c58166702161f7544e74995c43822017deb /db/migrate | |
parent | b4f4edd4eed2e469c2b19a12166232f48eaf2181 (diff) |
Support CURD operation for release asset links
- Add Releases::Links model
- Expose it in release API
- Add integration tests
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20181228175414_create_releases_link_table.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20181228175414_create_releases_link_table.rb b/db/migrate/20181228175414_create_releases_link_table.rb new file mode 100644 index 00000000000..bf1e50dd36e --- /dev/null +++ b/db/migrate/20181228175414_create_releases_link_table.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateReleasesLinkTable < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :release_links do |t| + t.references :release, null: false, index: false, foreign_key: { on_delete: :cascade } + t.string :url, null: false + t.string :name, null: false + t.timestamps_with_timezone null: false + + t.index [:release_id, :name], unique: true + end + end +end |