You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stmt.executeUpdate("DROP TABLE IF EXISTS ddbct1");
234
237
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS ddbct1 (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(250), comment MEDIUMTEXT, ts DATETIME)");
235
-
stmt.executeUpdate("INSERT INTO ddbct1 (name,comment) VALUES ('name1', 'comment for line 1'), ('name2','comment for line 2 - can be very long')");
238
+
stmt.executeUpdate("INSERT INTO ddbct1 (name, comment, ts)
239
+
VALUES
240
+
('name1', 'comment for line 1', CURRENT_TIMESTAMP),
241
+
('name2', 'comment for line 2 - can be very long', CURRENT_TIMESTAMP)");
242
+
243
+
stmt.executeUpdate("DROP TABLE IF EXISTS employee");
244
+
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS employee (
245
+
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
246
+
name VARCHAR(255) NOT NULL,
247
+
flags int null,
248
+
dob DATE,
249
+
created DATETIME,
250
+
updated DATETIME
251
+
)");
252
+
253
+
stmt.executeUpdate(`INSERT INTO employee (name, flags, dob, created, updated)
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS ddbct1 (id SERIAL PRIMARY KEY, name VARCHAR(250), comment TEXT, ts TIMESTAMP)");
239
-
stmt.executeUpdate("INSERT INTO ddbct1 (name,comment) VALUES ('name1', 'comment for line 1'), ('name2','comment for line 2 - can be very long')");
263
+
stmt.executeUpdate("DROP TABLE IF EXISTS ddbct1");
264
+
stmt.executeUpdate("CREATE TABLE ddbct1 (id SERIAL PRIMARY KEY, name VARCHAR(250), comment TEXT, ts TIMESTAMP)");
265
+
stmt.executeUpdate("INSERT INTO ddbct1 (name, comment, ts) VALUES ('name1', 'comment for line 1', CURRENT_TIMESTAMP), ('name2','comment for line 2 - can be very long', CURRENT_TIMESTAMP)");
266
+
267
+
stmt.executeUpdate(`DROP TABLE IF EXISTS "employee"`);
268
+
stmt.executeUpdate(`CREATE TABLE "employee" (
269
+
id SERIAL PRIMARY KEY,
270
+
name VARCHAR(255) NOT NULL,
271
+
flags int null,
272
+
dob DATE,
273
+
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
274
+
updated TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
275
+
)`);
276
+
277
+
stmt.executeUpdate(`INSERT INTO "employee" ("name", "flags", "dob", "created", "updated")
case"mysql": // MySQL has an underscore in 'AUTO_INCREMENT'
242
-
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS ddbct1 (id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(250), comment MEDIUMTEXT, ts DATETIME)");
243
-
stmt.executeUpdate("INSERT INTO ddbct1 (name,comment) VALUES ('name1', 'comment for line 1'), ('name2','comment for line 2 - can be very long')");
287
+
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS ddbct1 (id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(250), comment MEDIUMTEXT, ts TIMESTAMP)");
288
+
stmt.executeUpdate("INSERT INTO ddbct1 (name, comment, ts) VALUES ('name1', 'comment for line 1', CURRENT_TIMESTAMP), ('name2','comment for line 2 - can be very long', CURRENT_TIMESTAMP)");
289
+
290
+
//stmt.executeUpdate("DROP TABLE IF EXISTS employee");
291
+
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS employee (
292
+
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
293
+
name VARCHAR(255) NOT NULL,
294
+
flags int null,
295
+
dob DATE,
296
+
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
297
+
updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
298
+
)");
299
+
300
+
stmt.executeUpdate(`INSERT INTO employee (name, flags, dob, created, updated)
stmt.executeUpdate("DROP TABLE IF EXISTS dbo.ddbct1");
310
+
stmt.executeUpdate("DROP TABLE IF EXISTS ddbct1");
247
311
stmt.executeUpdate("CREATE TABLE ddbct1 (id INT NOT NULL IDENTITY(1,1) PRIMARY KEY, name VARCHAR(250), comment VARCHAR(max), ts DATETIME)");
248
-
stmt.executeUpdate("INSERT INTO ddbct1 (name, comment) VALUES ('name1', 'comment for line 1'), ('name2','comment for line 2 - can be very long')");
249
-
break;
312
+
stmt.executeUpdate("INSERT INTO ddbct1 (name, comment, ts) VALUES ('name1', 'comment for line 1', CURRENT_TIMESTAMP), ('name2','comment for line 2 - can be very long', CURRENT_TIMESTAMP)");
313
+
314
+
stmt.executeUpdate("DROP TABLE IF EXISTS [employee]");
0 commit comments