mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
cea2567e22
* add/register human command done * validations * crypto * move clientid * keys * fix: clientID * remove v2 package * tests * tests running * revert old code * instance domain from ctx * chore: rename zitadel app ids * comments * fix: test
37 lines
596 B
Go
37 lines
596 B
Go
package setup
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
const (
|
|
createAssets = `
|
|
CREATE TABLE system.assets (
|
|
instance_id TEXT,
|
|
asset_type TEXT,
|
|
resource_owner TEXT,
|
|
name TEXT,
|
|
content_type TEXT,
|
|
hash TEXT AS (md5(data)) STORED,
|
|
data BYTES,
|
|
updated_at TIMESTAMPTZ,
|
|
|
|
PRIMARY KEY (instance_id, resource_owner, name)
|
|
);
|
|
`
|
|
)
|
|
|
|
type AssetTable struct {
|
|
dbClient *sql.DB
|
|
}
|
|
|
|
func (mig *AssetTable) Execute(ctx context.Context) error {
|
|
_, err := mig.dbClient.ExecContext(ctx, createAssets)
|
|
return err
|
|
}
|
|
|
|
func (mig *AssetTable) String() string {
|
|
return "02_assets"
|
|
}
|