Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up migration, extract setting creation from migration, moved to…
… seed
- Loading branch information
1 parent
3bbf14c
commit 6cfb112
Showing
3 changed files
with
74 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class CreateMusic < ActiveRecord::Migration | ||
|
||
def self.up | ||
|
||
create_table :songs do |t| | ||
t.string :title | ||
t.string :artist | ||
t.text :description | ||
t.boolean :published, :default => true | ||
t.boolean :show_download_link, :default => true | ||
t.integer :resource_id | ||
t.integer :position | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :songs, :id | ||
add_index :songs, [:id, :published] | ||
|
||
create_table :music_settings do |t| | ||
t.string :name | ||
t.boolean :value | ||
t.string :color | ||
t.integer :size | ||
t.string :description | ||
t.datetime :created_at | ||
t.datetime :updated_at | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :music_settings, :id | ||
add_index :music_settings, :name | ||
|
||
load(Rails.root.join('db', 'seeds', 'music.rb')) | ||
end | ||
|
||
def self.down | ||
UserPlugin.destroy_all({:name => "music"}) | ||
|
||
Page.delete_all({:link_url => "/music"}) | ||
|
||
drop_table :songs | ||
drop_table :music_settings | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters