-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ac450a
commit cf14c91
Showing
5 changed files
with
50 additions
and
2 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
6 changes: 6 additions & 0 deletions
6
lib/generators/kebapage/install/templates/migrations/add_slug_to_kebapage_static_pages.rb
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,6 @@ | ||
class AddSlugToKebapageStaticPages < ActiveRecord::Migration | ||
def change | ||
add_column :kebapage_static_pages, :slug, :string | ||
add_index :kebapage_static_pages, :slug | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/generators/kebapage/install/templates/migrations/friendly_id_slugs.rb
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,15 @@ | ||
class CreateFriendlyIdSlugs < ActiveRecord::Migration | ||
def change | ||
create_table :friendly_id_slugs do |t| | ||
t.string :slug, :null => false | ||
t.integer :sluggable_id, :null => false | ||
t.string :sluggable_type, :limit => 50 | ||
t.string :scope | ||
t.datetime :created_at | ||
end | ||
add_index :friendly_id_slugs, :sluggable_id | ||
add_index :friendly_id_slugs, [:slug, :sluggable_type] | ||
add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], :unique => true | ||
add_index :friendly_id_slugs, :sluggable_type | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
lib/generators/kebapage/install/templates/migrations/photos.rb
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,10 @@ | ||
class CreateKebapagePhotos < ActiveRecord::Migration | ||
def change | ||
create_table :kebapage_photos do |t| | ||
t.attachment :photo | ||
t.references :static_page, index: true | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
lib/generators/kebapage/install/templates/migrations/static_pages.rb
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,10 @@ | ||
class CreateKebapageStaticPages < ActiveRecord::Migration | ||
def change | ||
create_table :kebapage_static_pages do |t| | ||
t.string :title | ||
t.text :content | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |