forked from Yasna1998/stackoverflow-in-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.cpp
More file actions
27 lines (24 loc) · 663 Bytes
/
Database.cpp
File metadata and controls
27 lines (24 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Database.h"
using namespace sqlite;
void init(){
database db("dbfile.db");
db << "create table user ("
"_id integer primary key autoincrement not null,"
"username text,"
"email text,"
"hash_pass text,"
"type text"
");";
db << "create table content ("
"_id integer primary key autoincrement not null,"
"body text,"
"user_id integer,"
"type text,"
"visits integer"
");";
db << "create table ContentRelation ("
"source_id integer,"
"destination_id integer,"
"type text"
");";
}