2023-05-28 19:59:57 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"blackforestbytes.com/simplecloudnotifier/db/schema"
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2024-06-01 01:01:58 +02:00
|
|
|
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
2023-05-28 19:59:57 +02:00
|
|
|
"gogs.mikescher.com/BlackForestBytes/goext/sq"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-06-01 01:01:58 +02:00
|
|
|
exerr.Init(exerr.ErrorPackageConfigInit{})
|
|
|
|
|
2023-05-28 19:59:57 +02:00
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
defer cancel()
|
|
|
|
|
|
|
|
sqlite3.Version() // ensure slite3 loaded
|
2024-06-01 01:01:58 +02:00
|
|
|
|
|
|
|
fmt.Println()
|
|
|
|
|
|
|
|
for i := 2; i <= schema.PrimarySchemaVersion; i++ {
|
2024-07-15 17:26:55 +02:00
|
|
|
h0, err := sq.HashGoSqliteSchema(ctx, schema.PrimarySchema[i].SQL)
|
2023-07-27 17:44:06 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
2024-06-01 01:01:58 +02:00
|
|
|
fmt.Printf("PrimarySchema%d := %s\n", i, h0)
|
2023-07-27 17:44:06 +02:00
|
|
|
}
|
2024-06-01 01:01:58 +02:00
|
|
|
|
|
|
|
for i := 1; i <= schema.RequestsSchemaVersion; i++ {
|
2024-07-15 17:26:55 +02:00
|
|
|
h0, err := sq.HashGoSqliteSchema(ctx, schema.RequestsSchema[i].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
2024-06-01 01:01:58 +02:00
|
|
|
fmt.Printf("RequestsSchema%d := %s\n", i, h0)
|
2023-05-28 19:59:57 +02:00
|
|
|
}
|
2024-06-01 01:01:58 +02:00
|
|
|
|
|
|
|
for i := 1; i <= schema.LogsSchemaVersion; i++ {
|
2024-07-15 17:26:55 +02:00
|
|
|
h0, err := sq.HashGoSqliteSchema(ctx, schema.LogsSchema[i].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
2024-06-01 01:01:58 +02:00
|
|
|
fmt.Printf("LogsSchema%d := %s\n", i, h0)
|
2023-05-28 19:59:57 +02:00
|
|
|
}
|
2024-06-01 01:01:58 +02:00
|
|
|
|
|
|
|
fmt.Println()
|
|
|
|
|
2023-05-28 19:59:57 +02:00
|
|
|
}
|