Sha256: 76d88b6dcd53c26f9cf6018a22528b6e6c2904cec6910e434fa0d66b53604638

Contents?: true

Size: 996 Bytes

Versions: 1

Compression:

Stored size: 996 Bytes

Contents

Sequel.migration do
  up do
    run %{CREATE EXTENSION hstore;}

    create_table :passbook_devices do
      primary_key :id

      column :pass_type_identifier, :varchar, unique: true, empty: false
      column :serial_number,        :varchar, empty: false
      column :authentication_token, :varchar
      column :data,                 :hstore
      column :created_at,           :timestamp
      column :updated_at,           :timestamp

      index :pass_type_identifier
      index :serial_number
    end

    create_table :passbook_registrations do
      primary_key :id

      column :pass_id,                    :int8,    null: false
      column :device_library_identifier,  :varchar, empty: false
      column :push_token,                 :varchar
      column :created_at,                 :timestamp
      column :updated_at,                 :timestamp

      index :device_library_identifier
    end
  end
  
  down do
    drop_table :devices
    drop_table :registrations
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-passbook-0.0.1 ./lib/rack/passbook/migrations/001_base_schema.rb