Class: TeleNotifyMigration

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/tele_notify/migration/templates/active_record/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



15
16
17
# File 'lib/generators/tele_notify/migration/templates/active_record/migration.rb', line 15

def self.down
  drop_table :telegram_users
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/tele_notify/migration/templates/active_record/migration.rb', line 3

def self.up
  create_table :telegram_users do |t|
    t.integer :telegram_id
    t.string :first_name
    t.string :username

    t.timestamps
  end

  add_index :telegram_users, :telegram_id
end