It is PRINCIPLES - truths; not PRINCIPALS - people in charge of schools or racing teams.
By deleteing the dev database, recreating it from migrations and then preparing the test database; the foreign key contraints now work. Also the database tables are now uft8mb4 instead of lantin1. May be an idea to do this every time there is a rails update until going live.
This commit is contained in:
parent
d1fe2f0470
commit
dda03a1a9a
@ -1,6 +1,6 @@
|
|||||||
GIT
|
GIT
|
||||||
remote: https://github.com/puma/puma
|
remote: https://github.com/puma/puma
|
||||||
revision: 3f4e3c8ca689e39218459836b939c39fa81e2692
|
revision: b67e6d594a473d5e0ab6317efb034ee5009570fe
|
||||||
branch: master
|
branch: master
|
||||||
specs:
|
specs:
|
||||||
puma (6.0.2)
|
puma (6.0.2)
|
||||||
@ -105,7 +105,7 @@ GEM
|
|||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
erubi (1.12.0)
|
erubi (1.12.0)
|
||||||
ffi (1.15.5)
|
ffi (1.15.5)
|
||||||
globalid (1.0.1)
|
globalid (1.1.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
i18n (1.12.0)
|
i18n (1.12.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
0wlK+j+11NIKe85Pfu3w0OdiLVM6fawzZlFSWnvy5fUqRC0A6dVV90yDOfPJh5QEFcvH0Yxe6KcWElZE3ZnYgHWJS9UspLfICs6W+hvNfoUoHW8jyO7fkwcj85RknNrjV+j+XavDFhSRk8wFhQDdLyH4DZrwVRJlCACikuBNcZKvrhe7OvgXvpzKukV4w8lm2MAV0onBSmqBNYv4/24blLb9rIJ17EJVS7TLTccq+fHcQzHT6qZHxRqT/AaRXWaCdoa356j35pmQcwjcaX0gfss9fQVf4zuk7BZqsGrQY7rxgyFsnmdaM6uaK6E8R9tiZjQweJkBOGqlTSZRfEIzdhNwY6FpCZF2xRjOscFOP74Qlbdt5CYNBRMZZM1Dfb3unfeiPj+TOqxKCvYrgqxINwkwe2R8FduyFej4--AYr+gbb69YPkX87U--cM9+bFKTYD1vwbH5k0gnYQ==
|
0wlK+j+11NIKe85Pfu3w0OdiLVM6fawzZlFSWnvy5fUqRC0A6dVV90yDOfPJh5QEFcvH0Yxe6KcWElZE3ZnYgHWJS9UspLfICs6W+hvNfoUoHW8jyO7fkwcj85RknNrjV+j+XavDFhSRk8wFhQDdLyH4DZrwVRJlCACikuBNcZKvrhe7OvgXvpzKukV4w8lm2MAV0onBSmqBNYv4/24blLb9rIJ17EJVS7TLTccq+fHcQzHT6qZHxRqT/AaRXWaCdoa356j35pmQcwjcaX0gfss9fQVf4zuk7BZqsGrQY7rxgyFsnmdaM6uaK6E8R9tiZjQweJkBOGqlTSZRfEIzdhNwY6FpCZF2xRjOscFOP74Qlbdt5CYNBRMZZM1Dfb3unfeiPj+TOqxKCvYrgqxINwkwe2R8FduyFej4--AYr+gbb69YPkX87U--cM9+bFKTYD1vwbH5k0gnYQ==
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
class CreateSubprincipalitemgroups < ActiveRecord::Migration[7.0]
|
class CreateSubprincipleitemgroups < ActiveRecord::Migration[7.0]
|
||||||
def change
|
def change
|
||||||
create_table :subprincipleitemgroups do |t|
|
create_table :subprincipleitemgroups do |t|
|
||||||
t.references :subprinciple, null: false, foreign_key: true
|
t.references :subprinciple, null: false, foreign_key: true
|
||||||
@ -1,6 +1,6 @@
|
|||||||
class CreateSubprincipalitems < ActiveRecord::Migration[7.0]
|
class CreateSubprincipleitems < ActiveRecord::Migration[7.0]
|
||||||
def change
|
def change
|
||||||
create_table :subprinciplitems do |t|
|
create_table :subprincipleitems do |t|
|
||||||
t.references :subprincipleitemgroup, null: false, foreign_key: true
|
t.references :subprincipleitemgroup, null: false, foreign_key: true
|
||||||
t.text :description
|
t.text :description
|
||||||
t.boolean :affirmative
|
t.boolean :affirmative
|
||||||
42
db/schema.rb
generated
42
db/schema.rb
generated
@ -11,7 +11,7 @@
|
|||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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: 2022_06_11_194255) do
|
||||||
create_table "action_text_rich_texts", charset: "latin1", force: :cascade do |t|
|
create_table "action_text_rich_texts", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.text "body", size: :long
|
t.text "body", size: :long
|
||||||
t.string "record_type", null: false
|
t.string "record_type", null: false
|
||||||
@ -21,7 +21,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
|
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "active_storage_attachments", charset: "latin1", force: :cascade do |t|
|
create_table "active_storage_attachments", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "record_type", null: false
|
t.string "record_type", null: false
|
||||||
t.bigint "record_id", null: false
|
t.bigint "record_id", null: false
|
||||||
@ -31,7 +31,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "active_storage_blobs", charset: "latin1", force: :cascade do |t|
|
create_table "active_storage_blobs", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.string "key", null: false
|
t.string "key", null: false
|
||||||
t.string "filename", null: false
|
t.string "filename", null: false
|
||||||
t.string "content_type"
|
t.string "content_type"
|
||||||
@ -43,13 +43,13 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "active_storage_variant_records", charset: "latin1", force: :cascade do |t|
|
create_table "active_storage_variant_records", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "blob_id", null: false
|
t.bigint "blob_id", null: false
|
||||||
t.string "variation_digest", null: false
|
t.string "variation_digest", null: false
|
||||||
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "cafs", charset: "latin1", force: :cascade do |t|
|
create_table "cafs", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "company_id", null: false
|
t.bigint "company_id", null: false
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.text "description"
|
t.text "description"
|
||||||
@ -58,20 +58,20 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["company_id"], name: "index_cafs_on_company_id"
|
t.index ["company_id"], name: "index_cafs_on_company_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "companies", charset: "latin1", force: :cascade do |t|
|
create_table "companies", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "companies_users", id: false, charset: "latin1", force: :cascade do |t|
|
create_table "companies_users", id: false, charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "user_id"
|
t.bigint "user_id"
|
||||||
t.bigint "company_id"
|
t.bigint "company_id"
|
||||||
t.index ["company_id"], name: "index_companies_users_on_company_id"
|
t.index ["company_id"], name: "index_companies_users_on_company_id"
|
||||||
t.index ["user_id"], name: "index_companies_users_on_user_id"
|
t.index ["user_id"], name: "index_companies_users_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "principles", charset: "latin1", force: :cascade do |t|
|
create_table "principles", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "caf_id", null: false
|
t.bigint "caf_id", null: false
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.text "description"
|
t.text "description"
|
||||||
@ -81,7 +81,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["name"], name: "index_principles_on_name"
|
t.index ["name"], name: "index_principles_on_name"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "subprincipleitemgroups", charset: "latin1", force: :cascade do |t|
|
create_table "subprincipleitemgroups", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "subprinciple_id", null: false
|
t.bigint "subprinciple_id", null: false
|
||||||
t.string "type"
|
t.string "type"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
@ -89,7 +89,16 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["subprinciple_id"], name: "index_subprincipleitemgroups_on_subprinciple_id"
|
t.index ["subprinciple_id"], name: "index_subprincipleitemgroups_on_subprinciple_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "subprinciples", charset: "latin1", force: :cascade do |t|
|
create_table "subprincipleitems", charset: "utf8mb4", force: :cascade do |t|
|
||||||
|
t.bigint "subprincipleitemgroup_id", null: false
|
||||||
|
t.text "description"
|
||||||
|
t.boolean "affirmative"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
t.index ["subprincipleitemgroup_id"], name: "index_subprincipleitems_on_subprincipleitemgroup_id"
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "subprinciples", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "principle_id", null: false
|
t.bigint "principle_id", null: false
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.text "description"
|
t.text "description"
|
||||||
@ -99,16 +108,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
t.index ["principle_id"], name: "index_subprinciples_on_principle_id"
|
t.index ["principle_id"], name: "index_subprinciples_on_principle_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "subprinciplitems", charset: "latin1", force: :cascade do |t|
|
create_table "users", charset: "utf8mb4", force: :cascade do |t|
|
||||||
t.bigint "subprincipleitemgroup_id", null: false
|
|
||||||
t.text "description"
|
|
||||||
t.boolean "affirmative"
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.datetime "updated_at", null: false
|
|
||||||
t.index ["subprincipleitemgroup_id"], name: "index_subprinciplitems_on_subprincipleitemgroup_id"
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "users", charset: "latin1", force: :cascade do |t|
|
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.string "encrypted_password", default: "", null: false
|
t.string "encrypted_password", default: "", null: false
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
@ -135,6 +135,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_11_194255) do
|
|||||||
add_foreign_key "cafs", "companies"
|
add_foreign_key "cafs", "companies"
|
||||||
add_foreign_key "principles", "cafs"
|
add_foreign_key "principles", "cafs"
|
||||||
add_foreign_key "subprincipleitemgroups", "subprinciples"
|
add_foreign_key "subprincipleitemgroups", "subprinciples"
|
||||||
|
add_foreign_key "subprincipleitems", "subprincipleitemgroups"
|
||||||
add_foreign_key "subprinciples", "principles"
|
add_foreign_key "subprinciples", "principles"
|
||||||
add_foreign_key "subprinciplitems", "subprincipleitemgroups"
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,3 +5,10 @@
|
|||||||
#
|
#
|
||||||
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
|
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
|
||||||
# Character.create(name: "Luke", movie: movies.first)
|
# Character.create(name: "Luke", movie: movies.first)
|
||||||
|
|
||||||
|
# admin_user = User.create(email: "here@there.com", password: "longandverystrongplease", role: 1000)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
subprincipleitemgroups
|
||||||
|
subprincipalitemgroups
|
||||||
|
|||||||
20
test/fixtures/cafs.yml
vendored
20
test/fixtures/cafs.yml
vendored
@ -1,11 +1,11 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
#
|
||||||
one:
|
# one:
|
||||||
company: one
|
# company: one
|
||||||
name: MyString
|
# name: MyString1
|
||||||
description: MyText
|
# description: MyText1
|
||||||
|
#
|
||||||
two:
|
# two:
|
||||||
company: two
|
# company: two
|
||||||
name: MyString
|
# name: MyString2
|
||||||
description: MyText
|
# description: MyText2
|
||||||
|
|||||||
10
test/fixtures/companies.yml
vendored
10
test/fixtures/companies.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
one:
|
# one:
|
||||||
name: HiddenAgendaLtd
|
# name: HiddenAgendaLtd
|
||||||
|
#
|
||||||
two:
|
# two:
|
||||||
name: CaudleMotorsports
|
# name: CaudleMotorsports
|
||||||
|
|||||||
20
test/fixtures/principles.yml
vendored
20
test/fixtures/principles.yml
vendored
@ -1,11 +1,11 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
#
|
||||||
one:
|
# one:
|
||||||
caf: one
|
# caf: one
|
||||||
name: MyString
|
# name: MyString
|
||||||
description: MyText
|
# description: MyText
|
||||||
|
#
|
||||||
two:
|
# two:
|
||||||
caf: two
|
# caf: two
|
||||||
name: MyString
|
# name: MyString
|
||||||
description: MyText
|
# description: MyText
|
||||||
|
|||||||
11
test/fixtures/subprincipalitems.yml
vendored
11
test/fixtures/subprincipalitems.yml
vendored
@ -1,11 +0,0 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
|
||||||
|
|
||||||
one:
|
|
||||||
subprincipleitemgroup: one
|
|
||||||
description: MyText
|
|
||||||
affirmative: false
|
|
||||||
|
|
||||||
two:
|
|
||||||
subprincipleitemgroup: two
|
|
||||||
description: MyText
|
|
||||||
affirmative: false
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
one:
|
# one:
|
||||||
subprinciple: one
|
# subprinciple: one
|
||||||
type:
|
# type:
|
||||||
|
#
|
||||||
two:
|
# two:
|
||||||
subprinciple: two
|
# subprinciple: two
|
||||||
type:
|
# type:
|
||||||
11
test/fixtures/subprincipleitems.yml
vendored
Normal file
11
test/fixtures/subprincipleitems.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
|
# one:
|
||||||
|
# subprincipleitemgroup: one
|
||||||
|
# description: MyText
|
||||||
|
# affirmative: false
|
||||||
|
#
|
||||||
|
# two:
|
||||||
|
# subprincipleitemgroup: two
|
||||||
|
# description: MyText
|
||||||
|
# affirmative: false
|
||||||
20
test/fixtures/subprinciples.yml
vendored
20
test/fixtures/subprinciples.yml
vendored
@ -1,11 +1,11 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
#
|
||||||
one:
|
# one:
|
||||||
principle: one
|
# principle: one
|
||||||
name: MyString
|
# name: MyString
|
||||||
description: MyText
|
# description: MyText
|
||||||
|
#
|
||||||
two:
|
# two:
|
||||||
principle: two
|
# principle: two
|
||||||
name: MyString
|
# name: MyString
|
||||||
description: MyText
|
# description: MyText
|
||||||
|
|||||||
10
test/fixtures/users.yml
vendored
10
test/fixtures/users.yml
vendored
@ -4,8 +4,8 @@
|
|||||||
# model remove the "{}" from the fixture names and add the columns immediately
|
# model remove the "{}" from the fixture names and add the columns immediately
|
||||||
# below each fixture, per the syntax in the comments below
|
# below each fixture, per the syntax in the comments below
|
||||||
#
|
#
|
||||||
one: {}
|
# one: {}
|
||||||
# column: value
|
# # column: value
|
||||||
#
|
# #
|
||||||
two: {}
|
# two: {}
|
||||||
# column: value
|
# # column: value
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class CompanyTest < ActiveSupport::TestCase
|
class CompanyTest < ActiveSupport::TestCase
|
||||||
test "compnay name can not be blank" do
|
test "company name can not be blank" do
|
||||||
c = Company.new
|
c = Company.new
|
||||||
assert !c.save
|
assert !c.save
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user