initial commit

This commit is contained in:
Stefan Tollkühn
2025-07-21 12:14:42 +02:00
parent a77fc87832
commit 3735122750
156 changed files with 3862 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
class CreateClients < ActiveRecord::Migration[8.0]
def change
create_table :clients do |t|
t.string :company_name
t.string :firstname
t.string :lastname
t.string :streetname
t.string :zipcode
t.string :city
t.string :country
t.string :email
t.string :phone
t.timestamps
end
end
end

View File

@@ -0,0 +1,9 @@
class CreateProjects < ActiveRecord::Migration[8.0]
def change
create_table :projects do |t|
t.string :name
t.timestamps
end
end
end

View File

@@ -0,0 +1,22 @@
class CreateSubprojects < ActiveRecord::Migration[8.0]
def change
create_table :subprojects do |t|
t.string :subproject_name
t.references :project, null: false, foreign_key: true
# client references
t.bigint :client_id, null: false
t.bigint :owner_id, null: false
t.bigint :builder_id, null: false
t.timestamps
end
add_foreign_key :subprojects, :clients, column: :client_id
add_foreign_key :subprojects, :clients, column: :owner_id
add_foreign_key :subprojects, :clients, column: :builder_id
add_index :subprojects, :client_id
add_index :subprojects, :owner_id
add_index :subprojects, :builder_id
end
end