about summary refs log tree commit diff stats
path: root/db
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2019-03-12 21:50:00 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2019-03-12 21:50:00 -0400
commit7789e2138fc0479846c20bc68d68973636a4a760 (patch)
treeef14af7a0a6e0de8f086a2b2db877840eb48904c /db
parent7a2d945f581c8ce9e322883ec597366143fe10cb (diff)
downloadthoughts-7789e2138fc0479846c20bc68d68973636a4a760.tar.gz
thoughts-7789e2138fc0479846c20bc68d68973636a4a760.tar.bz2
thoughts-7789e2138fc0479846c20bc68d68973636a4a760.zip
Started game tracker
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190312193025_install_audited.rb30
-rw-r--r--db/migrate/20190312193154_create_games.rb13
-rw-r--r--db/schema.rb34
3 files changed, 76 insertions, 1 deletions
diff --git a/db/migrate/20190312193025_install_audited.rb b/db/migrate/20190312193025_install_audited.rb new file mode 100644 index 0000000..ef5487e --- /dev/null +++ b/db/migrate/20190312193025_install_audited.rb
@@ -0,0 +1,30 @@
1class InstallAudited < ActiveRecord::Migration[5.2]
2 def self.up
3 create_table :audits, :force => true do |t|
4 t.column :auditable_id, :integer
5 t.column :auditable_type, :string
6 t.column :associated_id, :integer
7 t.column :associated_type, :string
8 t.column :user_id, :integer
9 t.column :user_type, :string
10 t.column :username, :string
11 t.column :action, :string
12 t.column :audited_changes, :text
13 t.column :version, :integer, :default => 0
14 t.column :comment, :string
15 t.column :remote_address, :string
16 t.column :request_uuid, :string
17 t.column :created_at, :datetime
18 end
19
20 add_index :audits, [:auditable_type, :auditable_id, :version], :name => 'auditable_index'
21 add_index :audits, [:associated_type, :associated_id], :name => 'associated_index'
22 add_index :audits, [:user_id, :user_type], :name => 'user_index'
23 add_index :audits, :request_uuid
24 add_index :audits, :created_at
25 end
26
27 def self.down
28 drop_table :audits
29 end
30end
diff --git a/db/migrate/20190312193154_create_games.rb b/db/migrate/20190312193154_create_games.rb new file mode 100644 index 0000000..de30492 --- /dev/null +++ b/db/migrate/20190312193154_create_games.rb
@@ -0,0 +1,13 @@
1class CreateGames < ActiveRecord::Migration[5.2]
2 def change
3 create_table :games do |t|
4 t.string :title
5 t.string :status
6 t.text :progress
7 t.text :description
8 t.integer :score
9
10 t.timestamps
11 end
12 end
13end
diff --git a/db/schema.rb b/db/schema.rb index 93085f3..c5c794f 100644 --- a/db/schema.rb +++ b/db/schema.rb
@@ -10,7 +10,29 @@
10# 10#
11# It's strongly recommended that you check this file into your version control system. 11# It's strongly recommended that you check this file into your version control system.
12 12
13ActiveRecord::Schema.define(version: 2018_08_11_215146) do 13ActiveRecord::Schema.define(version: 2019_03_12_193154) do
14
15 create_table "audits", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t|
16 t.integer "auditable_id"
17 t.string "auditable_type"
18 t.integer "associated_id"
19 t.string "associated_type"
20 t.integer "user_id"
21 t.string "user_type"
22 t.string "username"
23 t.string "action"
24 t.text "audited_changes"
25 t.integer "version", default: 0
26 t.string "comment"
27 t.string "remote_address"
28 t.string "request_uuid"
29 t.datetime "created_at"
30 t.index ["associated_type", "associated_id"], name: "associated_index"
31 t.index ["auditable_type", "auditable_id", "version"], name: "auditable_index"
32 t.index ["created_at"], name: "index_audits_on_created_at"
33 t.index ["request_uuid"], name: "index_audits_on_request_uuid"
34 t.index ["user_id", "user_type"], name: "user_index"
35 end
14 36
15 create_table "blogs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", force: :cascade do |t| 37 create_table "blogs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", force: :cascade do |t|
16 t.string "title" 38 t.string "title"
@@ -35,6 +57,16 @@ ActiveRecord::Schema.define(version: 2018_08_11_215146) do
35 t.index ["type"], name: "index_ckeditor_assets_on_type" 57 t.index ["type"], name: "index_ckeditor_assets_on_type"
36 end 58 end
37 59
60 create_table "games", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t|
61 t.string "title"
62 t.string "status"
63 t.text "progress"
64 t.text "description"
65 t.integer "score"
66 t.datetime "created_at", null: false
67 t.datetime "updated_at", null: false
68 end
69
38 create_table "links", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t| 70 create_table "links", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t|
39 t.string "title", null: false 71 t.string "title", null: false
40 t.string "url", null: false 72 t.string "url", null: false