summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-09-21 10:34:12 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-12-03 12:04:48 +0100
commit61864a5a5bb523953589c9398a431c4369fbfc76 (patch)
tree5eac32ef8155e9066d7d1488d7856e83605aa6a5 /db/migrate
parent25df666156279e5b392b429519b4f4ba01eefaac (diff)
downloadgitlab-ce-61864a5a5bb523953589c9398a431c4369fbfc76.tar.gz
Rename Artifact to JobArtifact, split metadata out
Two things at ones, as there was no clean way to seperate the commit and give me feedback from the tests. But the model Artifact is now JobArtifact, and the table does not have a type anymore, but the metadata is now its own model: Ci::JobArtifactMetadata.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170918072948_create_artifacts.rb21
-rw-r--r--db/migrate/20170918072948_create_job_artifacts.rb19
2 files changed, 19 insertions, 21 deletions
diff --git a/db/migrate/20170918072948_create_artifacts.rb b/db/migrate/20170918072948_create_artifacts.rb
deleted file mode 100644
index 1dd5edc3f15..00000000000
--- a/db/migrate/20170918072948_create_artifacts.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class CreateArtifacts < ActiveRecord::Migration
- 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 :type, default: 0, null: false
- t.integer :size, limit: 8, default: 0
-
- t.datetime_with_timezone :created_at, null: false
- t.datetime_with_timezone :updated_at, null: false
-
- t.text :file
- end
-
- add_index(:ci_artifacts, [:project_id, :ci_build_id], unique: true)
- end
-
- def down
- drop_table(:ci_artifacts)
- end
-end
diff --git a/db/migrate/20170918072948_create_job_artifacts.rb b/db/migrate/20170918072948_create_job_artifacts.rb
new file mode 100644
index 00000000000..6d1756f368c
--- /dev/null
+++ b/db/migrate/20170918072948_create_job_artifacts.rb
@@ -0,0 +1,19 @@
+class CreateJobArtifacts < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ create_table :ci_job_artifacts do |t|
+ t.belongs_to :project, null: false, index: true, foreign_key: { on_delete: :cascade }
+ t.integer :ci_job_id, null: false, index: true
+ t.integer :size, limit: 8
+ t.integer :file_type, null: false, index: true
+
+ t.datetime_with_timezone :created_at, null: false
+ t.datetime_with_timezone :updated_at, null: false
+
+ t.string :file
+ end
+ end
+end