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
|
||||
Loading…
Add table
Add a link
Reference in a new issue