A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
13
db/migrate/20240810081701_create_standards.rb
Normal file
13
db/migrate/20240810081701_create_standards.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class CreateStandards < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :standards do |t|
|
||||
t.string :name_de
|
||||
t.string :name_en
|
||||
t.string :version
|
||||
t.string :url_de
|
||||
t.string :url_en
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
# This migration comes from active_storage (originally 20190112182829)
|
||||
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
return unless table_exists?(:active_storage_blobs)
|
||||
|
||||
unless column_exists?(:active_storage_blobs, :service_name)
|
||||
add_column :active_storage_blobs, :service_name, :string
|
||||
|
||||
if configured_service = ActiveStorage::Blob.service.name
|
||||
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
|
||||
end
|
||||
|
||||
change_column :active_storage_blobs, :service_name, :string, null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
return unless table_exists?(:active_storage_blobs)
|
||||
|
||||
remove_column :active_storage_blobs, :service_name
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# This migration comes from active_storage (originally 20191206030411)
|
||||
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
return unless table_exists?(:active_storage_blobs)
|
||||
|
||||
# Use Active Record's configured type for primary key
|
||||
create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
|
||||
t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
|
||||
t.string :variation_digest, null: false
|
||||
|
||||
t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||
t.foreign_key :active_storage_blobs, column: :blob_id
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def primary_key_type
|
||||
config = Rails.configuration.generators
|
||||
config.options[config.orm][:primary_key_type] || :primary_key
|
||||
end
|
||||
|
||||
def blobs_primary_key_type
|
||||
pkey_name = connection.primary_key(:active_storage_blobs)
|
||||
pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name }
|
||||
pkey_column.bigint? ? :bigint : pkey_column.type
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# This migration comes from active_storage (originally 20211119233751)
|
||||
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
return unless table_exists?(:active_storage_blobs)
|
||||
|
||||
change_column_null(:active_storage_blobs, :checksum, true)
|
||||
end
|
||||
end
|
||||
10
db/migrate/20240819170606_create_principles.rb
Normal file
10
db/migrate/20240819170606_create_principles.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class CreatePrinciples < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :principles do |t|
|
||||
t.string :name_de
|
||||
t.string :name_en
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
26
db/migrate/20240820164827_finalize_check_fields.rb
Normal file
26
db/migrate/20240820164827_finalize_check_fields.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
class FinalizeCheckFields < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :checks, :number, :integer
|
||||
add_index :checks, :number, unique: true
|
||||
|
||||
add_column :checks, :name_de, :string
|
||||
add_column :checks, :name_en, :string
|
||||
|
||||
add_column :checks, :visual, :boolean, null: false, default: false
|
||||
add_column :checks, :auditory, :boolean, null: false, default: false
|
||||
add_column :checks, :physical, :boolean, null: false, default: false
|
||||
add_column :checks, :cognitive, :boolean, null: false, default: false
|
||||
|
||||
add_column :checks, :applicable_to_web, :boolean, null: false, default: false
|
||||
add_column :checks, :applicable_to_app, :boolean, null: false, default: false
|
||||
|
||||
add_reference :checks, :principle, foreign_key: true
|
||||
|
||||
add_column :checks, :external_number, :string, null: true
|
||||
add_column :checks, :conformity_level, :integer, null: false, default: 0
|
||||
add_column :checks, :priority, :integer, null: false, default: 0
|
||||
|
||||
add_column :checks, :manual_test, :boolean, null: false, default: true
|
||||
add_column :checks, :test_url, :string, null: true
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class AddChecksStandardsJoinTable < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_join_table :checks, :standards
|
||||
end
|
||||
end
|
||||
5
db/migrate/20240830134641_add_checks_links_join_table.rb
Normal file
5
db/migrate/20240830134641_add_checks_links_join_table.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddChecksLinksJoinTable < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_join_table :checks, :links
|
||||
end
|
||||
end
|
||||
50
db/schema.rb
generated
50
db/schema.rb
generated
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.1].define(version: 2024_07_25_173433) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_08_30_134641) do
|
||||
create_table "action_text_rich_texts", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.text "body"
|
||||
|
|
@ -73,6 +73,36 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_25_173433) do
|
|||
t.integer "level"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.boolean "applicability_web", default: false, null: false
|
||||
t.boolean "applicability_app", default: false, null: false
|
||||
t.string "exernal_number"
|
||||
t.integer "number"
|
||||
t.string "name_de"
|
||||
t.string "name_en"
|
||||
t.boolean "visual", default: false, null: false
|
||||
t.boolean "auditory", default: false, null: false
|
||||
t.boolean "physical", default: false, null: false
|
||||
t.boolean "cognitive", default: false, null: false
|
||||
t.boolean "applicable_to_web", default: false, null: false
|
||||
t.boolean "applicable_to_app", default: false, null: false
|
||||
t.integer "principle_id"
|
||||
t.string "external_number"
|
||||
t.integer "conformity_level", default: 0, null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.boolean "manual_test", default: true, null: false
|
||||
t.string "test_url"
|
||||
t.index ["number"], name: "index_checks_on_number", unique: true
|
||||
t.index ["principle_id"], name: "index_checks_on_principle_id"
|
||||
end
|
||||
|
||||
create_table "checks_links", id: false, force: :cascade do |t|
|
||||
t.integer "check_id", null: false
|
||||
t.integer "link_id", null: false
|
||||
end
|
||||
|
||||
create_table "checks_standards", id: false, force: :cascade do |t|
|
||||
t.integer "check_id", null: false
|
||||
t.integer "standard_id", null: false
|
||||
end
|
||||
|
||||
create_table "elements", force: :cascade do |t|
|
||||
|
|
@ -102,12 +132,29 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_25_173433) do
|
|||
t.index ["link_category_id"], name: "index_links_on_link_category_id"
|
||||
end
|
||||
|
||||
create_table "principles", force: :cascade do |t|
|
||||
t.string "name_de"
|
||||
t.string "name_en"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "reports", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "standards", force: :cascade do |t|
|
||||
t.string "name_de"
|
||||
t.string "name_en"
|
||||
t.string "version"
|
||||
t.string "url_de"
|
||||
t.string "url_en"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "success_criteria", force: :cascade do |t|
|
||||
t.integer "element_id", null: false
|
||||
t.string "title"
|
||||
|
|
@ -122,6 +169,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_25_173433) do
|
|||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "checklist_entries", "checklists"
|
||||
add_foreign_key "checklist_entries", "checks"
|
||||
add_foreign_key "checks", "principles"
|
||||
add_foreign_key "elements", "reports"
|
||||
add_foreign_key "links", "link_categories"
|
||||
add_foreign_key "success_criteria", "elements"
|
||||
|
|
|
|||
30
db/seeds.rb
30
db/seeds.rb
|
|
@ -1,9 +1,21 @@
|
|||
# This file should ensure the existence of records required to run the application in every environment (production,
|
||||
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
|
||||
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
|
||||
# MovieGenre.find_or_create_by!(name: genre_name)
|
||||
# end
|
||||
# Seed Standards
|
||||
Standard.create!(name_de: "WCAG",
|
||||
name_en: "WCAG",
|
||||
version: "2.1",
|
||||
url_de: "https://outline-rocks.github.io/wcag/translations/WCAG21-de/",
|
||||
url_en: "https://www.w3.org/TR/WCAG21/")
|
||||
Standard.create!(name_de: "eCH-0059",
|
||||
name_en: "eCH-0059",
|
||||
version: "3.0",
|
||||
url_de: "https://www.ech.ch/de/ech/ech-0059/3.0",
|
||||
url_en: "https://www.ech.ch/de/ech/ech-0059/3.0")
|
||||
Standard.create!(name_de: "EN 301 549",
|
||||
name_en: "EN 301 549",
|
||||
version: "V3",
|
||||
url_de: "https://www.etsi.org/deliver/etsi_en/301500_301599/301549/03.02.01_60/en_301549v030201p.pdf",
|
||||
url_en: "https://www.etsi.org/deliver/etsi_en/301500_301599/301549/03.02.01_60/en_301549v030201p.pdf")
|
||||
|
||||
Principle.create!(name_de: "Wahrnehmbar", name_en: "Perceivable")
|
||||
Principle.create!(name_de: "Bedienbar", name_en: "Operable")
|
||||
Principle.create!(name_de: "Verständlich", name_en: "Understandable")
|
||||
Principle.create!(name_de: "Robust", name_en: "Robust")
|
||||
Loading…
Add table
Add a link
Reference in a new issue