Skip to content

Commit 8d84baf

Browse files
committed
fixed an error in reset.js file
1 parent 69bc0aa commit 8d84baf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/config/reset.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ const createUserAddressTable = async () => {
165165

166166
const createOrdersTableQuery = async () => {
167167
const createOrdersTableQuery = `
168+
CREATE TABLE IF NOT EXISTS orders (
168169
id serial PRIMARY KEY,
169170
user_id integer NOT NULL,
170171
order_date timestamp DEFAULT CURRENT_TIMESTAMP,
171172
total_amount numeric(10, 2) NOT NULL,
172173
status varchar(50) DEFAULT 'Pending',
173-
FOREIGN KEY (user_id) REFERENCES users (id)
174+
FOREIGN KEY (user_id) REFERENCES users (id));
174175
`;
175176
try {
176177
const res = await pool.query(createOrdersTableQuery);

0 commit comments

Comments
 (0)