Merge migrations
This commit is contained in:
parent
d5e4edd52e
commit
4db0be18bc
5 changed files with 45 additions and 59 deletions
|
@ -1,20 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class CreateRSAPublicKeys < ActiveRecord::Migration[6.0]
|
|
||||||
include Partynest::Migration
|
|
||||||
|
|
||||||
def change
|
|
||||||
create_table :rsa_public_keys do |t|
|
|
||||||
t.timestamps null: false
|
|
||||||
|
|
||||||
t.text :pem, null: false
|
|
||||||
t.integer :bits, null: false
|
|
||||||
|
|
||||||
t.index :pem, unique: true
|
|
||||||
end
|
|
||||||
|
|
||||||
constraint :rsa_public_keys, :bits, <<~SQL
|
|
||||||
bits in (2048, 4096)
|
|
||||||
SQL
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,20 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class CreateX509CertificateRequests < ActiveRecord::Migration[6.0]
|
|
||||||
include Partynest::Migration
|
|
||||||
|
|
||||||
def change
|
|
||||||
create_table :x509_certificate_requests do |t|
|
|
||||||
t.timestamps null: false
|
|
||||||
|
|
||||||
t.references :rsa_public_key, null: false, foreign_key: true
|
|
||||||
|
|
||||||
t.string :distinguished_name, null: false
|
|
||||||
t.text :pem, null: false
|
|
||||||
end
|
|
||||||
|
|
||||||
constraint :x509_certificate_requests, :distinguished_name, <<~SQL
|
|
||||||
is_good_big_text(distinguished_name)
|
|
||||||
SQL
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,16 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class CreateX509Certificates < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
create_table :x509_certificates do |t|
|
|
||||||
t.timestamps null: false
|
|
||||||
|
|
||||||
t.references :x509_certificate_request, null: true, foreign_key: true
|
|
||||||
|
|
||||||
t.text :pem, null: false
|
|
||||||
|
|
||||||
t.datetime :not_before
|
|
||||||
t.datetime :not_after
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
44
db/migrate/20190911081459_create_x509_tables.rb
Normal file
44
db/migrate/20190911081459_create_x509_tables.rb
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class CreateX509Tables < ActiveRecord::Migration[6.0]
|
||||||
|
include Partynest::Migration
|
||||||
|
|
||||||
|
def change
|
||||||
|
create_table :rsa_public_keys do |t|
|
||||||
|
t.timestamps null: false
|
||||||
|
|
||||||
|
t.text :pem, null: false
|
||||||
|
t.integer :bits, null: false
|
||||||
|
|
||||||
|
t.index :pem, unique: true
|
||||||
|
end
|
||||||
|
|
||||||
|
constraint :rsa_public_keys, :bits, <<~SQL
|
||||||
|
bits in (2048, 4096)
|
||||||
|
SQL
|
||||||
|
|
||||||
|
create_table :x509_certificate_requests do |t|
|
||||||
|
t.timestamps null: false
|
||||||
|
|
||||||
|
t.references :rsa_public_key, null: false, foreign_key: true
|
||||||
|
|
||||||
|
t.string :distinguished_name, null: false
|
||||||
|
t.text :pem, null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
constraint :x509_certificate_requests, :distinguished_name, <<~SQL
|
||||||
|
is_good_big_text(distinguished_name)
|
||||||
|
SQL
|
||||||
|
|
||||||
|
create_table :x509_certificates do |t|
|
||||||
|
t.timestamps null: false
|
||||||
|
|
||||||
|
t.references :x509_certificate_request, null: true, foreign_key: true
|
||||||
|
|
||||||
|
t.text :pem, null: false
|
||||||
|
|
||||||
|
t.datetime :not_before
|
||||||
|
t.datetime :not_after
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1704,8 +1704,6 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||||
('20181129203927'),
|
('20181129203927'),
|
||||||
('20181130024918'),
|
('20181130024918'),
|
||||||
('20190910040709'),
|
('20190910040709'),
|
||||||
('20190910115511'),
|
('20190911081459');
|
||||||
('20190910133430'),
|
|
||||||
('20190910225118');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue