summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-12 11:17:42 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-20 12:10:26 -0200
commit41d8f5649e3c8a1e37be4608fd03153005c3fa58 (patch)
tree1a76ece3e4bab3327539f4417d911d3656444212 /db
parent040ae7e3e0c6f4d97fe6366bff9b05831283db7e (diff)
downloadgitlab-ce-41d8f5649e3c8a1e37be4608fd03153005c3fa58.tar.gz
Add task model
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160212123307_create_tasks.rb14
-rw-r--r--db/schema.rb18
2 files changed, 32 insertions, 0 deletions
diff --git a/db/migrate/20160212123307_create_tasks.rb b/db/migrate/20160212123307_create_tasks.rb
new file mode 100644
index 00000000000..c3f6f3abc26
--- /dev/null
+++ b/db/migrate/20160212123307_create_tasks.rb
@@ -0,0 +1,14 @@
+class CreateTasks < ActiveRecord::Migration
+ def change
+ create_table :tasks do |t|
+ t.references :user, null: false, index: true
+ t.references :project, null: false, index: true
+ t.references :target, polymorphic: true, null: false, index: true
+ t.integer :author_id, index: true
+ t.integer :action, null: false
+ t.string :state, null: false, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index af5bac63b42..183227a91ca 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -824,6 +824,24 @@ ActiveRecord::Schema.define(version: 20160217100506) do
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
+ create_table "tasks", force: :cascade do |t|
+ t.integer "user_id", null: false
+ t.integer "project_id", null: false
+ t.integer "target_id", null: false
+ t.string "target_type", null: false
+ t.integer "author_id"
+ t.integer "action", null: false
+ t.string "state", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "tasks", ["author_id"], name: "index_tasks_on_author_id", using: :btree
+ add_index "tasks", ["project_id"], name: "index_tasks_on_project_id", using: :btree
+ add_index "tasks", ["state"], name: "index_tasks_on_state", using: :btree
+ add_index "tasks", ["target_type", "target_id"], name: "index_tasks_on_target_type_and_target_id", using: :btree
+ add_index "tasks", ["user_id"], name: "index_tasks_on_user_id", using: :btree
+
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false