first commit
This commit is contained in:
10
db/migrate/20240807110147_create_articles.rb
Normal file
10
db/migrate/20240807110147_create_articles.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateArticles < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :articles do |t|
|
||||
t.string :title
|
||||
t.text :body
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20240807121058_create_comments.rb
Normal file
11
db/migrate/20240807121058_create_comments.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateComments < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :comments do |t|
|
||||
t.string :commenter
|
||||
t.text :body
|
||||
t.references :article, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20240807123935_add_status_to_articles.rb
Normal file
5
db/migrate/20240807123935_add_status_to_articles.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddStatusToArticles < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :articles, :status, :string, default: "public"
|
||||
end
|
||||
end
|
5
db/migrate/20240807123956_add_status_to_comments.rb
Normal file
5
db/migrate/20240807123956_add_status_to_comments.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddStatusToComments < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :comments, :status, :string, default: "public"
|
||||
end
|
||||
end
|
8
db/migrate/20240807144034_create_users.rb
Normal file
8
db/migrate/20240807144034_create_users.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class CreateUsers < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :users do |t|
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user