add migrations
This commit is contained in:
parent
d863d1c15b
commit
fe578ca3b2
3 changed files with 29 additions and 6 deletions
13
db/migrate/20160312234946_create_events.rb
Normal file
13
db/migrate/20160312234946_create_events.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
class CreateEvents < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :events do |t|
|
||||
t.string :kind, limit: 255
|
||||
t.references :eventable, polymorphic: true, index: true
|
||||
t.references :user, index: true
|
||||
t.references :map, index: true
|
||||
t.integer :sequence_id, index: true, default: nil, null: true
|
||||
t.timestamps
|
||||
end
|
||||
add_index :events, [:map_id, :sequence_id], unique: true
|
||||
end
|
||||
end
|
10
db/migrate/20160312235006_create_webhooks.rb
Normal file
10
db/migrate/20160312235006_create_webhooks.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class CreateWebhooks < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :webhooks do |t|
|
||||
t.references :hookable, polymorphic: true, index: true
|
||||
t.string :kind, null: false
|
||||
t.string :uri, null: false
|
||||
t.text :event_types, array: true, default: []
|
||||
end
|
||||
end
|
||||
end
|
12
db/schema.rb
12
db/schema.rb
|
@ -11,27 +11,27 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160310200131) do
|
||||
ActiveRecord::Schema.define(version: 20160312235006) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "events", force: :cascade do |t|
|
||||
t.string "kind", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "eventable_id"
|
||||
t.string "eventable_type", limit: 255
|
||||
t.string "eventable_type"
|
||||
t.integer "user_id"
|
||||
t.integer "map_id"
|
||||
t.integer "sequence_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "events", ["created_at"], name: "index_events_on_created_at", using: :btree
|
||||
add_index "events", ["eventable_type", "eventable_id"], name: "index_events_on_eventable_type_and_eventable_id", using: :btree
|
||||
add_index "events", ["map_id", "sequence_id"], name: "index_events_on_map_id_and_sequence_id", unique: true, using: :btree
|
||||
add_index "events", ["map_id"], name: "index_events_on_map_id", using: :btree
|
||||
add_index "events", ["eventable_type", "eventable_id"], name: "index_events_on_eventable_type_and_eventable_id", using: :btree
|
||||
add_index "events", ["sequence_id"], name: "index_events_on_sequence_id", using: :btree
|
||||
add_index "events", ["user_id"], name: "index_events_on_user_id", using: :btree
|
||||
|
||||
create_table "in_metacode_sets", force: :cascade do |t|
|
||||
t.integer "metacode_id"
|
||||
|
|
Loading…
Reference in a new issue