Sha256: f21bf4ef1770d91093b28b31bc3dc3af3c8f9bb1de759fc59b32f9f57e77fe5f

Contents?: true

Size: 713 Bytes

Versions: 5

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

require "active_record"

class CreateBaseModels < ::ActiveRecord::Migration[7.0]
  def change
    create_table :kanal_users do |t|
      t.string :username, null: false, index: { unique: true, name: "kanal_unique_usernames" }
      t.string :phone, null: true
      t.string :email, null: true

      t.timestamps
    end

    create_table :kanal_user_properties do |t|
      t.string :name, null: false
      t.string :raw_value, null: false
      # t.string :type, null: false

      t.timestamps
    end

    add_belongs_to :kanal_user_properties, :kanal_user, null: false, foreign_key: true

    add_index :kanal_user_properties, [:name, :kanal_user_id], unique: true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kanal-plugins-user_system-0.3.3 lib/kanal/plugins/user_system/migrations/20221124150000_create_base_models.rb
kanal-plugins-user_system-0.3.2 lib/kanal/plugins/user_system/migrations/20221124150000_create_base_models.rb
kanal-plugins-user_system-0.3.1 lib/kanal/plugins/user_system/migrations/20221124150000_create_base_models.rb
kanal-plugins-user_system-0.3.0 lib/kanal/plugins/user_system/migrations/20221124150000_create_base_models.rb
kanal-plugins-user_system-0.2.1 lib/kanal/plugins/user_system/migrations/20221124150000_create_base_models.rb