Project and Task models

This commit is contained in:
2025-06-21 23:46:15 +03:00
parent bc9896d074
commit ab477cb37c
5 changed files with 58 additions and 1 deletions
@@ -0,0 +1,12 @@
class CreateProjects < ActiveRecord::Migration[8.0]
def change
create_table :projects do |t|
t.string :name, null: false
t.string :code, null: false
t.timestamps
end
add_index :projects, :name
add_index :projects, :code, unique: true
end
end
+11
View File
@@ -0,0 +1,11 @@
class CreateTasks < ActiveRecord::Migration[8.0]
def change
create_table :tasks do |t|
t.references :project, null: false, foreign_key: true
t.integer :number, null: false
t.string :title, null: false
t.timestamps
end
end
end