Open VaishnavcveeZ opened 3 weeks ago
Gettting error while running application code for creating adaptor. The error will happen at the 2nd time.
Error - pq: relation \"IDX_casbin_rule_ptype\" already exists"
Steps- 1 . Create table for casbin CREATE TABLE IF NOT EXISTS "casbin_rule" ( "id" VARCHAR(100) NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(), "ptype" VARCHAR(100) NOT NULL , "v0" VARCHAR(100) NOT NULL, "v1" VARCHAR(100) NOT NULL, "v2" VARCHAR(100) NOT NULL, "v3" VARCHAR(100) NOT NULL, "v4" VARCHAR(100), "v5" VARCHAR(100) );
dsn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s search_path=%s timezone=%s sslmode=disable", Host, Port, User, Password, DbName, Schema, Timezone)
xormAdaptor, err := xormadapter.NewAdapter("postgres", dsn, true) if err != nil { slog.Error("xormadapter.NewAdapter", "err", err) return err }
@VaishnavcveeZ can you make a PR?
Gettting error while running application code for creating adaptor. The error will happen at the 2nd time.
Error - pq: relation \"IDX_casbin_rule_ptype\" already exists"
Steps- 1 . Create table for casbin CREATE TABLE IF NOT EXISTS "casbin_rule" ( "id" VARCHAR(100) NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(), "ptype" VARCHAR(100) NOT NULL , "v0" VARCHAR(100) NOT NULL, "v1" VARCHAR(100) NOT NULL, "v2" VARCHAR(100) NOT NULL, "v3" VARCHAR(100) NOT NULL, "v4" VARCHAR(100), "v5" VARCHAR(100) );
dsn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s search_path=%s timezone=%s sslmode=disable", Host, Port, User, Password, DbName, Schema, Timezone)
xormAdaptor, err := xormadapter.NewAdapter("postgres", dsn, true) if err != nil { slog.Error("xormadapter.NewAdapter", "err", err) return err }