This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/schema/migrations/008_album_migration.rb

20 lines
433 B
Ruby
Raw Permalink Normal View History

2008-06-27 00:13:15 -04:00
class AlbumMigration < ActiveRecord::Migration
def self.up
create_table :albums do |t|
t.string :name, :limit => 128
end
add_index :albums, :name
create_table :albums_tags, :id => false do |t|
t.integer :album_id
t.integer :tag_id
end
add_index :albums_tags, :album_id
add_index :albums_tags, :tag_id
end
def self.down
drop_table :albums
drop_table :albums_tags
end
end