diff options
| author | realtradam <[email protected]> | 2024-05-22 14:59:24 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-05-22 14:59:24 -0400 |
| commit | 6cf41b4a5c55c91974e31ac032d969c7481b3e80 (patch) | |
| tree | d0233a35a60f33f6d7115a26139fd6e61f96c15a /db | |
| parent | 3321db8f9c549103ebae46bf025a3135208a2e3b (diff) | |
| download | gameHolster-6cf41b4a5c55c91974e31ac032d969c7481b3e80.tar.gz gameHolster-6cf41b4a5c55c91974e31ac032d969c7481b3e80.zip | |
extract frontend
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20240409004746_create_blogs.rb | 14 | ||||
| -rw-r--r-- | db/migrate/20240519191604_create_users.rb (renamed from db/migrate/20240428013649_create_users.rb) | 3 | ||||
| -rw-r--r-- | db/migrate/20240521142838_create_active_storage_tables.active_storage.rb (renamed from db/migrate/20240503001922_create_active_storage_tables.active_storage.rb) | 0 | ||||
| -rw-r--r-- | db/migrate/20240521205000_create_games.rb (renamed from db/migrate/20240509225147_create_games.rb) | 4 | ||||
| -rw-r--r-- | db/schema.rb | 18 | ||||
| -rw-r--r-- | db/seeds.rb | 8 |
6 files changed, 6 insertions, 41 deletions
diff --git a/db/migrate/20240409004746_create_blogs.rb b/db/migrate/20240409004746_create_blogs.rb deleted file mode 100644 index 09b3442..0000000 --- a/db/migrate/20240409004746_create_blogs.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateBlogs < ActiveRecord::Migration[7.1] - def change - create_table :blogs do |t| - t.string :name, null: false - t.string :category, null: false - t.text :content, null: false - t.string :image, default: 'https://tradam.dev/images/logo.png' - t.date :live_date - t.date :update_date - - t.timestamps - end - end -end diff --git a/db/migrate/20240428013649_create_users.rb b/db/migrate/20240519191604_create_users.rb index 5eaaf2c..d1fa192 100644 --- a/db/migrate/20240428013649_create_users.rb +++ b/db/migrate/20240519191604_create_users.rb @@ -4,11 +4,10 @@ class CreateUsers < ActiveRecord::Migration[7.1] t.string :user_name # we need this for game urls t.string :identifier t.string :access_token_digest - t.string :salt t.json :user_data t.timestamps end - add_index :users, :identifier, unique: true + #add_index :users, :identifier, unique: true end end diff --git a/db/migrate/20240503001922_create_active_storage_tables.active_storage.rb b/db/migrate/20240521142838_create_active_storage_tables.active_storage.rb index e4706aa..e4706aa 100644 --- a/db/migrate/20240503001922_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20240521142838_create_active_storage_tables.active_storage.rb diff --git a/db/migrate/20240509225147_create_games.rb b/db/migrate/20240521205000_create_games.rb index 6303c3c..61f5bab 100644 --- a/db/migrate/20240509225147_create_games.rb +++ b/db/migrate/20240521205000_create_games.rb @@ -1,14 +1,14 @@ class CreateGames < ActiveRecord::Migration[7.1] def change create_table :games do |t| - t.belongs_to :user t.string :title t.string :titleSlug #t.text :body #t.integer :status, default: 0 - #t.references :user, null: false, foreign_key: true + #t.integer :order, default: 0 t.timestamps end + add_reference :games, :user, null: false, foreign_key: true end end diff --git a/db/schema.rb b/db/schema.rb index eca4cd1..a9b05b0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_05_09_225147) do +ActiveRecord::Schema[7.1].define(version: 2024_05_21_205000) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -42,23 +42,12 @@ ActiveRecord::Schema[7.1].define(version: 2024_05_09_225147) do t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true end - create_table "blogs", force: :cascade do |t| - t.string "name", null: false - t.string "category", null: false - t.text "content", null: false - t.string "image", default: "https://tradam.dev/images/logo.png" - t.date "live_date" - t.date "update_date" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "games", force: :cascade do |t| - t.bigint "user_id" t.string "title" t.string "titleSlug" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.bigint "user_id", null: false t.index ["user_id"], name: "index_games_on_user_id" end @@ -66,13 +55,12 @@ ActiveRecord::Schema[7.1].define(version: 2024_05_09_225147) do t.string "user_name" t.string "identifier" t.string "access_token_digest" - t.string "salt" t.json "user_data" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["identifier"], name: "index_users_on_identifier", unique: true end add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" + add_foreign_key "games", "users" end diff --git a/db/seeds.rb b/db/seeds.rb index 129cf7c..4fbd6ed 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -7,11 +7,3 @@ # ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| # MovieGenre.find_or_create_by!(name: genre_name) # end - -9.times do |i| - Blog.create!( - name: "Blog Post #{i + 1}", - content: "This is just some placeholder blog content :3", - category: "Test Blog", - ) -end |
