diff --git a/db.sqlite b/db.sqlite new file mode 100644 index 0000000..1addabc Binary files /dev/null and b/db.sqlite differ diff --git a/lib/store/sqlike/sqlike.go b/lib/store/sqlike/sqlike.go index 6f0bff3..babb9fa 100644 --- a/lib/store/sqlike/sqlike.go +++ b/lib/store/sqlike/sqlike.go @@ -51,8 +51,8 @@ func New(config ...SqlikeConfig) (*Sqlike, error) { s := &Sqlike{} // default settings s.config.DBType = "sqlite3" - s.config.DBHost = "db.sqlite" - s.config.DBName = "pastebin" + s.config.DBName = "db.sqlite" + s.config.DBTable = "pastebin" s.config.DBAccountsTable = "accounts" if len(config) > 0 { s.config = config[0] diff --git a/migration.sql b/migration.sql new file mode 100644 index 0000000..2a6adb2 --- /dev/null +++ b/migration.sql @@ -0,0 +1,17 @@ +CREATE TABLE `pastebin` ( + `id` varchar(30) NOT NULL, + `title` varchar(50) default NULL, + `hash` char(40) default NULL, + `data` longtext, + `delkey` char(40) default NULL, + `expiry` int, + `userid` varchar(255), + PRIMARY KEY (`id`) +); + +CREATE TABLE `accounts` ( + `email` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `key` varchar(255) NOT NULL, + PRIMARY KEY (`key`) +);