summaryrefslogtreecommitdiff
path: root/db/migrate/20190429082448_create_pages_domain_acme_orders.rb
blob: 75636031193d0e1fd47a66f8c528561e4f01d8f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class CreatePagesDomainAcmeOrders < ActiveRecord::Migration[5.1]
  include Gitlab::Database::MigrationHelpers

  # Set this constant to true if this migration requires downtime.
  DOWNTIME = false

  # rubocop:disable Migration/PreventStrings
  # rubocop:disable Migration/AddLimitToTextColumns
  def change
    create_table :pages_domain_acme_orders do |t|
      t.references :pages_domain, null: false, index: true, foreign_key: { on_delete: :cascade }, type: :integer

      t.datetime_with_timezone :expires_at, null: false
      t.timestamps_with_timezone null: false

      t.string :url, null: false

      t.string :challenge_token, null: false, index: true
      t.text :challenge_file_content, null: false

      t.text :encrypted_private_key, null: false
      t.text :encrypted_private_key_iv, null: false
    end
  end
  # rubocop:enable Migration/AddLimitToTextColumns
  # rubocop:enable Migration/PreventStrings
end