1
0
mirror of https://github.com/uptrace/go-clickhouse.git synced 2025-07-15 01:04:19 +02:00

feat: initial commit

This commit is contained in:
Vladimir Mihailenco
2022-01-23 09:36:24 +02:00
commit 092a2dbf28
125 changed files with 14450 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package migrations
import (
"context"
"fmt"
"github.com/uptrace/go-clickhouse/ch"
)
func init() {
Migrations.MustRegister(func(ctx context.Context, db *ch.DB) error {
fmt.Print(" [up migration] ")
return nil
}, func(ctx context.Context, db *ch.DB) error {
fmt.Print(" [down migration] ")
return nil
})
}

View File

@ -0,0 +1 @@
SELECT 'down migration'

View File

@ -0,0 +1 @@
SELECT 'up migration'

View File

@ -0,0 +1,18 @@
package migrations
import (
"embed"
"github.com/uptrace/go-clickhouse/chmigrate"
)
var Migrations = chmigrate.NewMigrations()
//go:embed *.sql
var sqlMigrations embed.FS
func init() {
if err := Migrations.Discover(sqlMigrations); err != nil {
panic(err)
}
}