Add migration to create Favorites table

This commit is contained in:
Justin Edmund 2022-02-27 19:03:21 -08:00
parent 438fc7294d
commit ac12d4cda3
2 changed files with 19 additions and 1 deletions

View 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

View file

@ -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"