Skip to content

Commit e8066f0

Browse files
authored
Merge pull request #5 from buzhangjiuzhou/main
Add Support for PostrgreSQL
2 parents 2b41c3c + fa575b3 commit e8066f0

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public static function personalConfig(\Typecho\Widget\Helper\Form $form)
240240
public static function dbInstall()
241241
{
242242
$installDb = Db::get();
243-
$type = array_pop(explode('_', $installDb->getAdapterName())); //数据库类型 mysql/sqlite
243+
$type = array_pop(explode('_', $installDb->getAdapterName())); //数据库类型 mysql/sqlite/postgres
244244
$prefix = $installDb->getPrefix(); //表前缀
245245

246246
$scripts = file_get_contents(__DIR__ . '/sql/' . $type . '.sql');

log/.gitkeep

Whitespace-only changes.

sql/Pgsql.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE IF NOT EXISTS typecho_mail (
2+
id SERIAL PRIMARY KEY,
3+
content text NOT NULL,
4+
sent int DEFAULT 0
5+
);

0 commit comments

Comments
 (0)