first commit
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddStatusToArticles < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :articles, :status, :string, default: "public"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddStatusToComments < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :comments, :status, :string, default: "public"
|
||||
end
|
||||
end
|
||||
@@ -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