We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69bc0aa commit 8d84bafCopy full SHA for 8d84baf
server/config/reset.js
@@ -165,12 +165,13 @@ const createUserAddressTable = async () => {
165
166
const createOrdersTableQuery = async () => {
167
const createOrdersTableQuery = `
168
+ CREATE TABLE IF NOT EXISTS orders (
169
id serial PRIMARY KEY,
170
user_id integer NOT NULL,
171
order_date timestamp DEFAULT CURRENT_TIMESTAMP,
172
total_amount numeric(10, 2) NOT NULL,
173
status varchar(50) DEFAULT 'Pending',
- FOREIGN KEY (user_id) REFERENCES users (id)
174
+ FOREIGN KEY (user_id) REFERENCES users (id));
175
`;
176
try {
177
const res = await pool.query(createOrdersTableQuery);
0 commit comments