Skip to content

Commit

Permalink
migration
Browse files Browse the repository at this point in the history
  • Loading branch information
benawad committed Aug 17, 2020
1 parent 947ecac commit acc316c
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 301 deletions.
10 changes: 10 additions & 0 deletions server/ormconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "postgres",
"database": "lireddit3",
"entities": ["dist/entities/*.js"],
"migrations": ["dist/migrations/*.js"]
}
3 changes: 2 additions & 1 deletion server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = async () => {
type: "postgres",
url: process.env.DATABASE_URL,
logging: true,
synchronize: true,
// synchronize: true,
migrations: [path.join(__dirname, "./migrations/*")],
entities: [Post, User, Updoot],
});
Expand All @@ -36,6 +36,7 @@ const main = async () => {

const RedisStore = connectRedis(session);
const redis = new Redis(process.env.REDIS_URL);
app.set("proxy", 1);
app.use(
cors({
origin: process.env.CORS_ORIGIN,
Expand Down
Loading

0 comments on commit acc316c

Please sign in to comment.