Skip to content

Commit

Permalink
testing postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyotown committed Feb 2, 2020
1 parent f5ed0be commit ef3b9d2
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 40 deletions.
4 changes: 2 additions & 2 deletions data/migrations/20200129201151_UserAndPatients.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports.up = async knex => {
.string("UserName", 50)
.notNullable()
.unique();
table.string("Password", 240).notNullable(),
table.varchar("Password", 240).notNullable(),
table.integer("PhoneNumber", 11).notNullable(),
table.date("DueDate"),
table.string("Email", 128),
Expand All @@ -18,7 +18,7 @@ exports.up = async knex => {
.string("UserName", 50)
.notNullable()
.unique();
table.string("Password", 240).notNullable(),
table.varchar("Password", 240).notNullable(),
table.integer("PhoneNumber", 11).notNullable(),
table.string("Vehicle", 128),
table.string("Shift", 128),
Expand Down
12 changes: 6 additions & 6 deletions data/seeds/Drivers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ exports.seed = function(knex) {
{
FullName: "Tom Jerry",
UserName: "tomjerry",
password:
Password:
"$2a$14$YeVVr3J4PXWTM.STM0PGAOsruLqg7y8PeW4Rsi4/LftHCk1e5FSI2",
PhoneNumber: "1234567891",
Vehicle: "Motorcycle",
Shift: "PM",
Price: "$50",
Price: "50",
Email: "[email protected]",
City: "Kampala"
},
{
FullName: "Martha Stewart",
UserName: "marthastewart",
password:
Password:
"$2a$14$YeVVr3J4PXWTM.STM0PGAOsruLqg7y8PeW4Rsi4/LftHCk1e5FSI2",
PhoneNumber: "1234567891",
Vehicle: "SUV",
Shift: "AM",
Price: "$35",
Price: "35",
Email: "[email protected]",
City: "Kampala"
},
{
FullName: "Dan Abramov",
UserName: "danabramov",
password:
Password:
"$2a$14$YeVVr3J4PXWTM.STM0PGAOsruLqg7y8PeW4Rsi4/LftHCk1e5FSI2",
PhoneNumber: "1234567891",
Vehicle: "Motorcycle",
Shift: "AM",
Price: "$42",
Price: "42",
Email: "[email protected]",
City: "Jinja"
}
Expand Down
22 changes: 4 additions & 18 deletions knexfile.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
module.exports = {
development: {
client: "sqlite3",
client: "pg",
useNullAsDefault: true,
connection: {
filename: "./data/RideForLife.db3"
},
pool: {
afterCreate: (conn, done) => {
conn.run("PRAGMA foreign_keys = ON", done);
}
},
connection: `${process.env.DATABASE_URL} + ssl=true`,
migrations: {
directory: "./data/migrations"
},
Expand All @@ -18,16 +11,9 @@ module.exports = {
}
},
production: {
client: "sqlite3",
client: "pg",
useNullAsDefault: true,
connection: {
filename: "./data/RideForLife.db3"
},
pool: {
afterCreate: (conn, done) => {
conn.run("PRAGMA foreign_keys = ON", done);
}
},
connection: `${process.env.DATABASE_URL} + ssl=true`,
migrations: {
directory: "./data/migrations"
},
Expand Down
14 changes: 7 additions & 7 deletions node_modules/dotenv/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions node_modules/express/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 126 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"jsonwebtoken": "^8.5.1",
"knex": "^0.20.8",
"node-pre-gyp": "^0.14.0",
"pg": "^7.18.1",
"postgresql": "0.0.1",
"sqlite3": "^4.1.1"
},
"devDependencies": {
Expand Down

0 comments on commit ef3b9d2

Please sign in to comment.