diff --git a/app/models/observer.rb b/app/models/observer.rb new file mode 100644 index 0000000..e69de29 diff --git a/db/migrate/20230127091956_create_objectives.rb b/db/migrate/20230127091956_create_objectives.rb new file mode 100644 index 0000000..7f6e935 --- /dev/null +++ b/db/migrate/20230127091956_create_objectives.rb @@ -0,0 +1,11 @@ +class CreateObjectives < ActiveRecord::Migration[7.0] + def change + create_table :objectives do |t| + t.references :caf, null: false, foreign_key: true + t.string :name + t.text :description + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 8c037f2..5c7fafc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do +ActiveRecord::Schema[7.0].define(version: 2023_01_27_091956) do create_table "action_text_rich_texts", charset: "utf8mb4", force: :cascade do |t| t.string "name", null: false t.text "body", size: :long @@ -71,6 +71,15 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do t.index ["user_id"], name: "index_companies_users_on_user_id" end + create_table "objectives", charset: "utf8mb4", force: :cascade do |t| + t.bigint "caf_id", null: false + t.string "name" + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["caf_id"], name: "index_objectives_on_caf_id" + end + create_table "principles", charset: "utf8mb4", force: :cascade do |t| t.bigint "caf_id", null: false t.string "name" @@ -133,6 +142,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "cafs", "companies" + add_foreign_key "objectives", "cafs" add_foreign_key "principles", "cafs" add_foreign_key "subprincipleitemgroups", "subprinciples" add_foreign_key "subprincipleitems", "subprincipleitemgroups" diff --git a/test/models/.principle_test.rb.kate-swp b/test/models/.principle_test.rb.kate-swp new file mode 100644 index 0000000..f0c0833 Binary files /dev/null and b/test/models/.principle_test.rb.kate-swp differ