|
21 | 21 | compatibilityMode = CompatibilityMode.MySQL, |
22 | 22 | initialSqls = |
23 | 23 | "CREATE TABLE customer_transactions (" |
24 | | - + " transaction_id INT PRIMARY KEY," |
25 | | - + " customer_id INT NOT NULL," |
26 | | - + " transaction_date DATE NOT NULL," |
27 | | - + " amount DECIMAL(10,2) NOT NULL," |
28 | | - + " transaction_type ENUM('purchase', 'refund') NOT NULL" |
29 | | - + ");" |
30 | | - + "INSERT INTO customer_transactions" |
31 | | - + "(transaction_id, customer_id, transaction_date, amount, transaction_type)" |
32 | | - + "VALUES" |
33 | | - + "(1, 101, '2024-01-05', 150.00, 'purchase')," |
34 | | - + "(2, 101, '2024-01-15', 200.00, 'purchase')," |
35 | | - + "(3, 101, '2024-02-10', 180.00, 'purchase')," |
36 | | - + "(4, 101, '2024-02-20', 250.00, 'purchase')," |
37 | | - + "(5, 102, '2024-01-10', 100.00, 'purchase')," |
38 | | - + "(6, 102, '2024-01-12', 120.00, 'purchase')," |
39 | | - + "(7, 102, '2024-01-15', 80.00, 'refund')," |
40 | | - + "(8, 102, '2024-01-18', 90.00, 'refund')," |
41 | | - + "(9, 102, '2024-02-15', 130.00, 'purchase')," |
42 | | - + "(10, 103, '2024-01-01', 500.00, 'purchase')," |
43 | | - + "(11, 103, '2024-01-02', 450.00, 'purchase')," |
44 | | - + "(12, 103, '2024-01-03', 400.00, 'purchase')," |
45 | | - + "(13, 104, '2024-01-01', 200.00, 'purchase')," |
46 | | - + "(14, 104, '2024-02-01', 250.00, 'purchase')," |
47 | | - + "(15, 104, '2024-02-15', 300.00, 'purchase')," |
48 | | - + "(16, 104, '2024-03-01', 350.00, 'purchase')," |
49 | | - + "(17, 104, '2024-03-10', 280.00, 'purchase')," |
50 | | - + "(18, 104, '2024-03-15', 100.00, 'refund');") |
| 24 | + + " transaction_id INT PRIMARY KEY," |
| 25 | + + " customer_id INT NOT NULL," |
| 26 | + + " transaction_date DATE NOT NULL," |
| 27 | + + " amount DECIMAL(10,2) NOT NULL," |
| 28 | + + " transaction_type ENUM('purchase', 'refund') NOT NULL" |
| 29 | + + ");" |
| 30 | + + "INSERT INTO customer_transactions" |
| 31 | + + "(transaction_id, customer_id, transaction_date, amount, transaction_type)" |
| 32 | + + "VALUES" |
| 33 | + + "(1, 101, '2024-01-05', 150.00, 'purchase')," |
| 34 | + + "(2, 101, '2024-01-15', 200.00, 'purchase')," |
| 35 | + + "(3, 101, '2024-02-10', 180.00, 'purchase')," |
| 36 | + + "(4, 101, '2024-02-20', 250.00, 'purchase')," |
| 37 | + + "(5, 102, '2024-01-10', 100.00, 'purchase')," |
| 38 | + + "(6, 102, '2024-01-12', 120.00, 'purchase')," |
| 39 | + + "(7, 102, '2024-01-15', 80.00, 'refund')," |
| 40 | + + "(8, 102, '2024-01-18', 90.00, 'refund')," |
| 41 | + + "(9, 102, '2024-02-15', 130.00, 'purchase')," |
| 42 | + + "(10, 103, '2024-01-01', 500.00, 'purchase')," |
| 43 | + + "(11, 103, '2024-01-02', 450.00, 'purchase')," |
| 44 | + + "(12, 103, '2024-01-03', 400.00, 'purchase')," |
| 45 | + + "(13, 104, '2024-01-01', 200.00, 'purchase')," |
| 46 | + + "(14, 104, '2024-02-01', 250.00, 'purchase')," |
| 47 | + + "(15, 104, '2024-02-15', 300.00, 'purchase')," |
| 48 | + + "(16, 104, '2024-03-01', 350.00, 'purchase')," |
| 49 | + + "(17, 104, '2024-03-10', 280.00, 'purchase')," |
| 50 | + + "(18, 104, '2024-03-15', 100.00, 'refund');") |
51 | 51 | class MysqlTest { |
52 | 52 | @Test |
53 | 53 | void testScript(@EmbeddedDatabase DataSource dataSource) |
|
0 commit comments