Add migration to create Favorites table
This commit is contained in:
parent
438fc7294d
commit
ac12d4cda3
2 changed files with 19 additions and 1 deletions
9
db/migrate/20220228014758_create_favorites.rb
Normal file
9
db/migrate/20220228014758_create_favorites.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class CreateFavorites < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :favorites, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||
t.references :user, type: :uuid
|
||||
t.references :party, type: :uuid
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/schema.rb
11
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_02_27_042147) do
|
||||
ActiveRecord::Schema.define(version: 2022_02_28_014758) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
|
|
@ -44,6 +44,15 @@ ActiveRecord::Schema.define(version: 2022_02_27_042147) do
|
|||
t.integer "max_atk_ulb"
|
||||
end
|
||||
|
||||
create_table "favorites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.uuid "user_id"
|
||||
t.uuid "party_id"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["party_id"], name: "index_favorites_on_party_id"
|
||||
t.index ["user_id"], name: "index_favorites_on_user_id"
|
||||
end
|
||||
|
||||
create_table "grid_characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.uuid "party_id"
|
||||
t.uuid "character_id"
|
||||
|
|
|
|||
Loading…
Reference in a new issue