Add fields to models
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class AddCompletedAndPriorityToTodos < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
add_column :todos, :completed, :boolean, default: false, null: false
|
||||
add_column :todos, :priority, :integer, default: 1, null: false
|
||||
end
|
||||
end
|
||||
5
db/migrate/20251027122702_add_active_to_projects.rb
Normal file
5
db/migrate/20251027122702_add_active_to_projects.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddActiveToProjects < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
add_column :projects, :active, :boolean, default: true, null: false
|
||||
end
|
||||
end
|
||||
5
db/schema.rb
generated
5
db/schema.rb
generated
@@ -10,17 +10,20 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_10_27_095143) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_10_27_122702) do
|
||||
create_table "projects", force: :cascade do |t|
|
||||
t.boolean "active", default: true, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.string "name"
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "todos", force: :cascade do |t|
|
||||
t.boolean "completed", default: false, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.text "description"
|
||||
t.string "name"
|
||||
t.integer "priority", default: 1, null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user