Preparation for using an embedded database #55
This commit is contained in:
parent
90d73e4a61
commit
53dfd1647a
|
@ -14,8 +14,8 @@ before_script:
|
|||
- docker-compose -f docker-compose.travis.yml up -d --build
|
||||
|
||||
script:
|
||||
- if [ "$TRAVIS_BRANCH" == "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all migrate test-codecov; fi
|
||||
- if [ "$TRAVIS_BRANCH" != "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all migrate test; fi
|
||||
- if [ "$TRAVIS_BRANCH" == "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all install migrate test-codecov; fi
|
||||
- if [ "$TRAVIS_BRANCH" != "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all install migrate test; fi
|
||||
|
||||
after_script:
|
||||
- docker-compose -f docker-compose.travis.yml down
|
||||
|
|
2
assets/database/.gitignore
vendored
Normal file
2
assets/database/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
|
@ -8,7 +8,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
_ "github.com/jinzhu/gorm/dialects/mssql" // Import gorm drivers
|
||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
|
|
|
@ -32,6 +32,11 @@ var exportPath = GetExpandedFilename(testDataPath + "/export")
|
|||
var databaseDriver = "mysql"
|
||||
var databaseDsn = "photoprism:photoprism@tcp(database:3306)/photoprism?parseTime=true"
|
||||
|
||||
func init() {
|
||||
conf := NewTestConfig()
|
||||
conf.MigrateDb()
|
||||
}
|
||||
|
||||
func (c *Config) RemoveTestData(t *testing.T) {
|
||||
os.RemoveAll(c.ImportPath)
|
||||
os.RemoveAll(c.ExportPath)
|
||||
|
|
Loading…
Reference in a new issue