Sha256: d7a7a7a6e0966b503d58079a64621a55807a58105461c1d4ff9d430d780adcd6

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

class CreateTanshukuUrls < ActiveRecord::Migration[7.0]
  def change
    create_table :tanshuku_urls do |t|
      t.text :url, null: false

      # You might adjust the `limit: 128` depending on `Tanshuku.config.url_hasher`.
      t.string :hashed_url, null: false, limit: 128, index: { unique: true }, comment: "cf. Tanshuku::Url.hash_url"

      # You might adjust the `limit: 20` depending on `.key_length` and `.key_generator` of `Tanshuku.config`.
      t.string :key, null: false, limit: 20, index: { unique: true }, comment: "cf. Tanshuku::Url.generate_key"

      t.datetime :created_at, null: false, precision: nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tanshuku-4.0.0 db/migrate/20230220123456_create_tanshuku_urls.rb