aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--database.json.sample9
-rw-r--r--migrations/20131110050923-add-users.js26
3 files changed, 36 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index f8756461..10c71482 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ public/bitcoins.pdf
node_modules
config.js
builtAssets
+database.json
diff --git a/database.json.sample b/database.json.sample
new file mode 100644
index 00000000..688560dd
--- /dev/null
+++ b/database.json.sample
@@ -0,0 +1,9 @@
+{
+ "dev": {
+ "driver": "pg",
+ "user": "you",
+ "password": "password",
+ "host": "localhost",
+ "database": "pos"
+ }
+}
diff --git a/migrations/20131110050923-add-users.js b/migrations/20131110050923-add-users.js
new file mode 100644
index 00000000..47911db8
--- /dev/null
+++ b/migrations/20131110050923-add-users.js
@@ -0,0 +1,26 @@
+var dbm = require('db-migrate');
+var type = dbm.dataType;
+
+exports.up = function(db, callback) {
+ db.createTable('users', {
+ id: { type: 'int', primaryKey: true },
+ username: { type: 'string' },
+ password: { type: 'string' },
+ first_name: { type: 'string' },
+ last_name: { type: 'string' },
+ email: { type: 'string' },
+ phone: { type: 'string' },
+ company: { type: 'string' },
+ category: { type: 'string' },
+ website: { type: 'string' },
+ location: { type: 'string' },
+ city: { type: 'string' },
+ postal_code: { type: 'string' },
+ province: { type: 'string' },
+ country: { type: 'string' }
+ }, callback);
+};
+
+exports.down = function(db, callback) {
+ db.dropTable('users', callback);
+};