fix: create tables only if they do not exist
This commit is contained in:
parent
9cf526456a
commit
ac11a8ee5b
@ -2,7 +2,7 @@ use rusqlite::{Connection, Result};
|
||||
|
||||
pub fn init(conn: &Connection) -> Result<()> {
|
||||
conn.execute(
|
||||
"CREATE TABLE accounts (
|
||||
"CREATE TABLE IF NOT EXISTS accounts (
|
||||
id INTEGER PRIMARY KEY,
|
||||
username TEXT,
|
||||
email TEXT,
|
||||
@ -12,7 +12,7 @@ pub fn init(conn: &Connection) -> Result<()> {
|
||||
)?;
|
||||
|
||||
conn.execute(
|
||||
"CREATE TABLE scripts (
|
||||
"CREATE TABLE IF NOT EXISTS scripts (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT,
|
||||
last_edit DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
|
Loading…
Reference in New Issue
Block a user