if not exists on table create
This commit is contained in:
parent
d725fef5fa
commit
f39777d255
2
main.ts
2
main.ts
|
@ -10,7 +10,7 @@ const db = new DB("scrappy.db");
|
||||||
const command = Deno.args[0];
|
const command = Deno.args[0];
|
||||||
|
|
||||||
if (command === "create") {
|
if (command === "create") {
|
||||||
db.execute(`create table channel (id INTEGER PRIMARY KEY AUTOINCREMENT, channel_id text not null unique, channel_name text not null, last_seen_at number not null default 0);`);
|
db.execute(`create table if not exists channel (id INTEGER PRIMARY KEY AUTOINCREMENT, channel_id text not null unique, channel_name text not null, last_seen_at number not null default 0);`);
|
||||||
}
|
}
|
||||||
else if (command === "new" && Deno.args.length == 3) {
|
else if (command === "new" && Deno.args.length == 3) {
|
||||||
const channelId = Deno.args[1];
|
const channelId = Deno.args[1];
|
||||||
|
|
Loading…
Reference in New Issue