diff --git a/server/hard_schema.db b/server/hard_schema.db new file mode 100644 index 0000000..d3670dd Binary files /dev/null and b/server/hard_schema.db differ diff --git a/server/src/db/_init_sql.cpp b/server/src/db/_init_sql.cpp index 7ab01f5..32ced8f 100644 --- a/server/src/db/_init_sql.cpp +++ b/server/src/db/_init_sql.cpp @@ -6,6 +6,27 @@ const char* _mem_db_sql = const std::vector _hard_db_sql = { /** START MIGRATION 0 **/ - "CREATE TABLE ", + "CREATE TABLE `MIGRATIONS` (" + "`ID` INTEGER NOT NULL," + "`SQL_HASH` TEXT NOT NULL," + "`DATE_RAN` INTEGER NOT NULL," + "PRIMARY KEY(`ID`)" + ") WITHOUT ROWID;\n" + + "CREATE TABLE `USERS` (" + "`ID` INTEGER PRIMARY KEY AUTOINCREMENT," + "`USERNAME` TEXT NOT NULL," + "`PASS_HASH` TEXT NOT NULL," + "`EMAIL` TEXT NOT NULL," + "`ACTIVATED` INTEGER NOT NULL DEFAULT 0," + "`JOINED` INTEGER NOT NULL" + ");\n" + + "CREATE TABLE `ACTIVATION_CODES` (" + "`USER_ID` INTEGER NOT NULL UNIQUE," + "`CODE` TEXT NOT NULL," + "`CREATED` INTEGER NOT NULL," + "PRIMARY KEY(`USER_ID`)" + ") WITHOUT ROWID;\n", /** END MIGRATION 0 **/ }; \ No newline at end of file