diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2017-09-18 15:33:24 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:04:47 +0100 |
commit | 8ac7f29726989bc0a20ee32780aa18625159f8b4 (patch) | |
tree | 756e41340d54143ee6a29e68cbde28ab9369d46f /db/migrate | |
parent | 636376dd4d41856cc965718725f06bb8caacfd34 (diff) | |
download | gitlab-ce-8ac7f29726989bc0a20ee32780aa18625159f8b4.tar.gz |
Create ci_artifacts table
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170918072948_create_artifacts.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/db/migrate/20170918072948_create_artifacts.rb b/db/migrate/20170918072948_create_artifacts.rb index 0b3241070ce..dd0af2a7066 100644 --- a/db/migrate/20170918072948_create_artifacts.rb +++ b/db/migrate/20170918072948_create_artifacts.rb @@ -1,8 +1,24 @@ class CreateArtifacts < ActiveRecord::Migration - def change - create_table :artifacts do |t| + def up + create_table :ci_artifacts do |t| + t.belongs_to :project, null: false, foreign_key: { on_delete: :cascade } + t.belongs_to :ci_build, null: false, foreign_key: { on_delete: :cascade } + t.integer :size, limit: 8, default: 0 - t.timestamps null: false + t.datetime_with_timezone :created_at, null: false + t.datetime_with_timezone :updated_at, null: false + + t.datetime_with_timezone :expire_at + t.integer :erased_by_id, null: false + t.datetime_with_timezone :erased_at + + t.text :file end + + add_index(:ci_artifacts, [:project_id, :ci_build_id], unique: true) + end + + def down + drop_table(:ci_artifacts) end end |