diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 226ef77..4ba8058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,11 +29,11 @@ jobs: steps: - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.21 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run Unit tests run: go test -v -coverprofile=profile.cov ./... @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run semantic-release if: github.repository == 'casbin/xorm-adapter' && github.event_name == 'push' diff --git a/adapter.go b/adapter.go index 69c5ca5..ac96060 100644 --- a/adapter.go +++ b/adapter.go @@ -37,13 +37,13 @@ func (the *CasbinRule) TableName() string { // CasbinRule . type CasbinRule struct { - Ptype string `xorm:"varchar(100) index not null default ''"` - V0 string `xorm:"varchar(100) index not null default ''"` - V1 string `xorm:"varchar(100) index not null default ''"` - V2 string `xorm:"varchar(100) index not null default ''"` - V3 string `xorm:"varchar(100) index not null default ''"` - V4 string `xorm:"varchar(100) index not null default ''"` - V5 string `xorm:"varchar(100) index not null default ''"` + Ptype string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` + V0 string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` + V1 string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` + V2 string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` + V3 string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` + V4 string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` + V5 string `xorm:"varchar(100) index(IF NOT EXISTS) not null default ''"` tableName string `xorm:"-"` }