aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate.rb.sample14
-rw-r--r--db/migrations/001_create_users.rb10
2 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate.rb.sample b/db/migrate.rb.sample
new file mode 100644
index 00000000..4e6a9f77
--- /dev/null
+++ b/db/migrate.rb.sample
@@ -0,0 +1,14 @@
+require 'rubygems'
+require 'active_record'
+
+ActiveRecord::Base.establish_connection(
+ :adapter=>'mysql2',
+ :hostname => 'localhost',
+ :username => 'root',
+ :password => '',
+ :database => 'bitcoin_pos',
+ :reconnect => true
+)
+
+ActiveRecord::Migration.verbose = true
+ActiveRecord::Migrator.migrate "migrations/"
diff --git a/db/migrations/001_create_users.rb b/db/migrations/001_create_users.rb
new file mode 100644
index 00000000..4225589d
--- /dev/null
+++ b/db/migrations/001_create_users.rb
@@ -0,0 +1,10 @@
+class CreateUsers < ActiveRecord::Migration
+ def change
+ create_table :users do |t|
+ t.string :name
+ t.string :address
+ t.decimal :credit, :precision => 10, :scale => 2
+ t.string :logo
+ end
+ end
+end