mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-19 03:51:30 +08:00

* feat: added license manager and feature flags * feat: completed org domain api * chore: checking in saml auth handler code * feat: added signup with sso * feat: added login support for admins * feat: added pem support for certificate * ci(build-workflow): 👷 include EE query-service * fix: 🐛 update package name * chore(ee): 🔧 LD_FLAGS related changes Signed-off-by: Prashant Shahi <prashant@signoz.io> Co-authored-by: Prashant Shahi <prashant@signoz.io> Co-authored-by: nityanandagohain <nityanandagohain@gmail.com>
33 lines
639 B
Go
33 lines
639 B
Go
package sqlite
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
)
|
|
|
|
func InitDB(db *sqlx.DB) error {
|
|
var err error
|
|
if db == nil {
|
|
return fmt.Errorf("invalid db connection")
|
|
}
|
|
|
|
table_schema := `CREATE TABLE IF NOT EXISTS usage(
|
|
id UUID PRIMARY KEY,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
activation_id UUID,
|
|
snapshot TEXT,
|
|
synced BOOLEAN DEFAULT 'false',
|
|
synced_at TIMESTAMP,
|
|
failed_sync_request_count INTEGER DEFAULT 0
|
|
);
|
|
`
|
|
|
|
_, err = db.Exec(table_schema)
|
|
if err != nil {
|
|
return fmt.Errorf("error in creating usage table: %v", err.Error())
|
|
}
|
|
return nil
|
|
}
|