587f9552c8
create_links and slug index migrations. generate_slug and shorten model methods - Create links migration - Add slug index migration
14 lines
257 B
Ruby
14 lines
257 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateLinks < ActiveRecord::Migration[5.2]
|
|
def change
|
|
create_table :links do |t|
|
|
t.string :slug, null: false
|
|
t.text :url
|
|
t.integer :click_counter, default: 0
|
|
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|