class CreatePublicCharges < ActiveRecord::Migration[6.1]
  def change
    create_table :PublicCharges, id: false do |t|
      t.primary_key "PCID"
      t.column "PublicID", :string, limit: 36, null: false
      t.column "SchoolID", :bigint, null: false, unsigned: true
      t.column "AcctID", :bigint, null: false, unsigned: true
      t.column "ACID", :bigint, null: false, unsigned: true
      t.column "EndAt", :date
      t.column "CreatedAt", :timestamp, null: false, default: -> { "CURRENT_TIMESTAMP" }
    end

    add_index :PublicCharges, :PCID, unique: true, name: "cnid_index"
    add_index :PublicCharges, :SchoolID, name: "charge_schoolid_index"
  end
end
