summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2015-02-25 18:47:09 -0800
committerJesse Morgan <jesse@jesterpm.net>2015-02-25 18:47:09 -0800
commit4e94e31aa0acda54ae962840b57ae42ca6e71185 (patch)
tree19fa5fdc8c3bea56fb93463508a81514acd0f604 /db/migrate
parentf031bdc3e5214c699123830d8cc9f9309b792a68 (diff)
rails generate scaffold Download
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20150226024550_create_downloads.rb15
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