This commit is contained in:
parent
3c63282dd9
commit
c36b69af0e
|
@ -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]
|
||||
|
|
|
@ -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`)
|
||||
);
|
Loading…
Reference in New Issue