forked from mbulat/plutus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generator for adding date field to entries
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 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,11 @@ | ||
require 'rails/generators' | ||
require 'rails/generators/migration' | ||
require_relative 'base_generator' | ||
|
||
module Plutus | ||
class AddDateUpgradeGenerator < BaseGenerator | ||
def create_migration_file | ||
migration_template 'add_date_migration.rb', 'db/migrate/add_date_to_plutus_entries.rb' | ||
end | ||
end | ||
end |
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 AddDateToPlutusEntries < ActiveRecord::Migration | ||
def change | ||
add_column :plutus_entries, :date, :date | ||
add_index :plutus_entries, :date | ||
end | ||
end |