mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
PostgreSQL prep
Update of vendored SQL libs and refactoring of store provider layer.
This commit is contained in:
parent
d0e005f638
commit
b455e5eaf5
105 changed files with 10949 additions and 2376 deletions
|
@ -21,9 +21,9 @@ import (
|
|||
|
||||
// Scripts holds all .SQL files for all supported database providers.
|
||||
type Scripts struct {
|
||||
MySQLScripts []Script
|
||||
PostgresSQLScripts []Script
|
||||
SQLServerScripts []Script
|
||||
MySQL []Script
|
||||
PostgreSQL []Script
|
||||
SQLServer []Script
|
||||
}
|
||||
|
||||
// Script holds SQL script and it's associated version number.
|
||||
|
@ -37,7 +37,12 @@ func LoadScripts() (s Scripts, err error) {
|
|||
assetDir := "bindata/scripts"
|
||||
|
||||
// MySQL
|
||||
s.MySQLScripts, err = loadFiles(fmt.Sprintf("%s/mysql", assetDir))
|
||||
s.MySQL, err = loadFiles(fmt.Sprintf("%s/mysql", assetDir))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// PostgreSQL
|
||||
s.PostgreSQL, err = loadFiles(fmt.Sprintf("%s/postgresql", assetDir))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -49,11 +54,11 @@ func LoadScripts() (s Scripts, err error) {
|
|||
func SpecificScripts(runtime *env.Runtime, all Scripts) (s []Script) {
|
||||
switch runtime.StoreProvider.Type() {
|
||||
case env.StoreTypeMySQL, env.StoreTypeMariaDB, env.StoreTypePercona:
|
||||
return all.MySQLScripts
|
||||
return all.MySQL
|
||||
case env.StoreTypePostgreSQL:
|
||||
return all.PostgresSQLScripts
|
||||
return all.PostgreSQL
|
||||
case env.StoreTypeMSSQL:
|
||||
return all.SQLServerScripts
|
||||
return all.SQLServer
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue