This commit is contained in:
a 2022-08-03 05:06:44 -05:00
parent 3c63282dd9
commit c36b69af0e
3 changed files with 19 additions and 2 deletions

BIN
db.sqlite Normal file

Binary file not shown.

View File

@ -51,8 +51,8 @@ func New(config ...SqlikeConfig) (*Sqlike, error) {
s := &Sqlike{} s := &Sqlike{}
// default settings // default settings
s.config.DBType = "sqlite3" s.config.DBType = "sqlite3"
s.config.DBHost = "db.sqlite" s.config.DBName = "db.sqlite"
s.config.DBName = "pastebin" s.config.DBTable = "pastebin"
s.config.DBAccountsTable = "accounts" s.config.DBAccountsTable = "accounts"
if len(config) > 0 { if len(config) > 0 {
s.config = config[0] s.config = config[0]

17
migration.sql Normal file
View File

@ -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`)
);