Remove unnecessary migrations
This commit is contained in:
parent
51808390f1
commit
261331d752
|
@ -1,53 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateX509Tables < ActiveRecord::Migration[6.0]
|
||||
include Partynest::Migration
|
||||
|
||||
def change
|
||||
create_table :asymmetric_keys do |t|
|
||||
t.timestamps null: false
|
||||
t.string :type, null: false
|
||||
t.index %i[type id], unique: true
|
||||
|
||||
t.references :account, foreign_key: true
|
||||
|
||||
t.text :public_key_pem, null: false
|
||||
t.binary :public_key_der, null: false
|
||||
|
||||
t.binary :private_key_pem_iv
|
||||
t.binary :private_key_pem_ciphertext
|
||||
|
||||
t.boolean :has_password, null: false
|
||||
t.string :sha1, null: false
|
||||
t.string :sha256, null: false
|
||||
|
||||
t.integer :bits
|
||||
t.string :curve
|
||||
|
||||
t.index :public_key_pem, unique: true
|
||||
t.index :public_key_der, unique: true
|
||||
t.index :sha1, unique: true
|
||||
t.index :sha256, unique: true
|
||||
end
|
||||
|
||||
add_constraint :asymmetric_keys, :bits, <<~SQL
|
||||
bits IS NULL OR bits IN (2048, 4096)
|
||||
SQL
|
||||
|
||||
add_constraint :asymmetric_keys, :curve, <<~SQL
|
||||
curve IS NULL OR curve IN ('prime256v1', 'secp384r1')
|
||||
SQL
|
||||
|
||||
create_table :x509_certificates do |t|
|
||||
t.timestamps null: false
|
||||
|
||||
t.references :asymmetric_key, null: false, foreign_key: true
|
||||
|
||||
t.text :pem, null: false
|
||||
t.string :subject, null: false
|
||||
t.string :issuer, null: false
|
||||
t.datetime :not_before, null: false
|
||||
t.datetime :not_after, null: false
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AllowNullHasPasswordOnAsymmetricKeys < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
change_column :asymmetric_keys, :has_password, :boolean, null: true
|
||||
end
|
||||
dir.down do
|
||||
change_column :asymmetric_keys, :has_password, :boolean, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,8 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DropX509Tables < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
drop_table :x509_certificates
|
||||
drop_table :asymmetric_keys
|
||||
end
|
||||
end
|
|
@ -1611,9 +1611,6 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||
('20181129203927'),
|
||||
('20181130024918'),
|
||||
('20190910040709'),
|
||||
('20190911081459'),
|
||||
('20190915085803'),
|
||||
('20190915131325'),
|
||||
('20190921142404'),
|
||||
('20190921161613'),
|
||||
('20190921191213'),
|
||||
|
|
Reference in New Issue