summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
committerMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
commitbe2a93525069de2dfa3c23b0c23e7a9f7ad4c03d (patch)
treeb5493e9d35d024ce7be072ec2168b4a98ba0e63f /db/migrate
First commit.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20241226110255_create_tartiflettes.rb9
-rw-r--r--db/migrate/20241226113752_create_scores.rb11
-rw-r--r--db/migrate/20241226113815_create_scoring_criteria.rb10
-rw-r--r--db/migrate/20241227180909_create_users.rb11
-rw-r--r--db/migrate/20241227180910_create_sessions.rb11
-rw-r--r--db/migrate/20241227181134_add_admin_to_users.rb5
6 files changed, 57 insertions, 0 deletions
diff --git a/db/migrate/20241226110255_create_tartiflettes.rb b/db/migrate/20241226110255_create_tartiflettes.rb
new file mode 100644
index 0000000..17ee93f
--- /dev/null
+++ b/db/migrate/20241226110255_create_tartiflettes.rb
@@ -0,0 +1,9 @@
+class CreateTartiflettes < ActiveRecord::Migration[8.0]
+ def change
+ create_table :tartiflettes do |t|
+ t.integer :scoring_id
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20241226113752_create_scores.rb b/db/migrate/20241226113752_create_scores.rb
new file mode 100644
index 0000000..488baaa
--- /dev/null
+++ b/db/migrate/20241226113752_create_scores.rb
@@ -0,0 +1,11 @@
+class CreateScores < ActiveRecord::Migration[8.0]
+ def change
+ create_table :scores do |t|
+ t.references :tartiflette, null: false, foreign_key: true
+ t.references :scoring_criterium, null: false, foreign_key: true
+ t.integer :value
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20241226113815_create_scoring_criteria.rb b/db/migrate/20241226113815_create_scoring_criteria.rb
new file mode 100644
index 0000000..8370529
--- /dev/null
+++ b/db/migrate/20241226113815_create_scoring_criteria.rb
@@ -0,0 +1,10 @@
+class CreateScoringCriteria < ActiveRecord::Migration[8.0]
+ def change
+ create_table :scoring_criteria do |t|
+ t.string :name
+ t.string :category
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20241227180909_create_users.rb b/db/migrate/20241227180909_create_users.rb
new file mode 100644
index 0000000..2075edf
--- /dev/null
+++ b/db/migrate/20241227180909_create_users.rb
@@ -0,0 +1,11 @@
+class CreateUsers < ActiveRecord::Migration[8.0]
+ def change
+ create_table :users do |t|
+ t.string :email_address, null: false
+ t.string :password_digest, null: false
+
+ t.timestamps
+ end
+ add_index :users, :email_address, unique: true
+ end
+end
diff --git a/db/migrate/20241227180910_create_sessions.rb b/db/migrate/20241227180910_create_sessions.rb
new file mode 100644
index 0000000..8102f13
--- /dev/null
+++ b/db/migrate/20241227180910_create_sessions.rb
@@ -0,0 +1,11 @@
+class CreateSessions < ActiveRecord::Migration[8.0]
+ def change
+ create_table :sessions do |t|
+ t.references :user, null: false, foreign_key: true
+ t.string :ip_address
+ t.string :user_agent
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20241227181134_add_admin_to_users.rb b/db/migrate/20241227181134_add_admin_to_users.rb
new file mode 100644
index 0000000..c1f08cf
--- /dev/null
+++ b/db/migrate/20241227181134_add_admin_to_users.rb
@@ -0,0 +1,5 @@
+class AddAdminToUsers < ActiveRecord::Migration[8.0]
+ def change
+ add_column :users, :admin, :boolean, default: false
+ end
+end
Copyright 2019--2025 Marius PETER