Skip to content

Commit 29b2267

Browse files
author
Antonio Musarra
committed
Versione 2.2.0 migrazione SQL (errata DDL)
1 parent c0ade9b commit 29b2267

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- Creazione della tabella payments e di un indice sulla colonna payment_method
2+
3+
CREATE TABLE payments (
4+
id SERIAL PRIMARY KEY,
5+
user_id INT NOT NULL,
6+
amount DECIMAL(10, 2) NOT NULL,
7+
payment_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
8+
payment_method VARCHAR(50),
9+
status VARCHAR(20),
10+
transaction_id VARCHAR(100) UNIQUE,
11+
FOREIGN KEY (user_id) REFERENCES users(id)
12+
);
13+
14+
-- Creazione di un indice sulla colonna payment_method della tabella payments
15+
-- per velocizzare le query di ricerca per metodo di pagamento
16+
-- La DDL contiene appositamente l'errore di sintassi per testare il rollback'
17+
CREATE INDEX idx_payment_method ON payments();

0 commit comments

Comments
 (0)