mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-29 16:06:36 +08:00
Merge pull request #97 from Sagit-chu/opencode/glowing-orchid
fix: backend postgresql
This commit is contained in:
@@ -1414,7 +1414,7 @@ func ensurePostgresTableIDDefault(db *store.DB, schemaName, tableName string) er
|
||||
|
||||
var serialSeq sql.NullString
|
||||
if err := db.QueryRow(`
|
||||
SELECT pg_get_serial_sequence(format('%I.%I', ?, ?), 'id')
|
||||
SELECT pg_get_serial_sequence(quote_ident(?) || '.' || quote_ident(?), 'id')
|
||||
`, schemaName, tableName).Scan(&serialSeq); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+3
-1
@@ -250,7 +250,9 @@ get_current_db_type() {
|
||||
db_type=$(get_env_var "DB_TYPE")
|
||||
database_url=$(get_env_var "DATABASE_URL")
|
||||
|
||||
if [[ "$db_type" == "postgres" || "$database_url" == postgres://* || "$database_url" == postgresql://* ]]; then
|
||||
if [[ "$db_type" == "sqlite" ]]; then
|
||||
echo "sqlite"
|
||||
elif [[ "$db_type" == "postgres" || "$database_url" == postgres://* || "$database_url" == postgresql://* ]]; then
|
||||
echo "postgres"
|
||||
else
|
||||
echo "sqlite"
|
||||
|
||||
Reference in New Issue
Block a user