diff options
| author | Jesse Morgan <jesse@jesterpm.net> | 2015-02-25 18:47:09 -0800 | 
|---|---|---|
| committer | Jesse Morgan <jesse@jesterpm.net> | 2015-02-25 18:47:09 -0800 | 
| commit | 4e94e31aa0acda54ae962840b57ae42ca6e71185 (patch) | |
| tree | 19fa5fdc8c3bea56fb93463508a81514acd0f604 /db | |
| parent | f031bdc3e5214c699123830d8cc9f9309b792a68 (diff) | |
rails generate scaffold Download
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20150226024550_create_downloads.rb | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/db/migrate/20150226024550_create_downloads.rb b/db/migrate/20150226024550_create_downloads.rb new file mode 100644 index 0000000..4033e0c --- /dev/null +++ b/db/migrate/20150226024550_create_downloads.rb @@ -0,0 +1,15 @@ +class CreateDownloads < ActiveRecord::Migration +  def change +    create_table :downloads do |t| +      t.string :name +      t.string :filename +      t.string :type +      t.text :description +      t.integer :hits + +      t.timestamps null: false +    end +    add_index :downloads, :filename, unique: true +    add_index :downloads, :hits +  end +end | 
