diff options
author | Matthew Lemon <y@yulqen.org> | 2024-11-14 15:47:43 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-11-14 15:47:43 +0000 |
commit | 6427b28c60c6ed0dfd637307d1ab4ffe65c1144d (patch) | |
tree | 156d280b94557f9606c053f6187aec2a21eb1b36 /db/migrate | |
parent | 1b64b0b709c5704de48120e20bdfad32f34b0b5d (diff) |
Adds ResourceType model
Diffstat (limited to '')
-rw-r--r-- | db/migrate/20241114152218_create_resource_types.rb | 9 | ||||
-rw-r--r-- | db/migrate/20241114152810_add_resource_type_to_pdf_resource.rb | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/db/migrate/20241114152218_create_resource_types.rb b/db/migrate/20241114152218_create_resource_types.rb new file mode 100644 index 0000000..f7f9de6 --- /dev/null +++ b/db/migrate/20241114152218_create_resource_types.rb @@ -0,0 +1,9 @@ +class CreateResourceTypes < ActiveRecord::Migration[8.0] + def change + create_table :resource_types do |t| + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20241114152810_add_resource_type_to_pdf_resource.rb b/db/migrate/20241114152810_add_resource_type_to_pdf_resource.rb new file mode 100644 index 0000000..e1c853b --- /dev/null +++ b/db/migrate/20241114152810_add_resource_type_to_pdf_resource.rb @@ -0,0 +1,5 @@ +class AddResourceTypeToPdfResource < ActiveRecord::Migration[8.0] + def change + add_reference :pdfresources, :resource_type, foreign_key: true + end +end |