Documentation ¶
Index ¶
- type Create
- type Migrator
- func (m *Migrator) Commit() error
- func (m *Migrator) MigrateAffiliationsTable() error
- func (m *Migrator) MigrateCertificatesTable() error
- func (m *Migrator) MigrateCredentialsTable() error
- func (m *Migrator) MigrateNoncesTable() error
- func (m *Migrator) MigrateRAInfoTable() error
- func (m *Migrator) MigrateUsersTable() error
- func (m *Migrator) Rollback() error
- type Sqlite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Create ¶
type Create interface { Exec(funcName, query string, args ...interface{}) (sql.Result, error) Rebind(query string) string Rollback(funcName string) error Commit(funcName string) error }
Create is interface that defines functions need to create database transaction
type Migrator ¶
Migrator defines migrator
func NewMigrator ¶
func NewMigrator(tx db.FabricCATx, curLevels, srvLevels *util.Levels) *Migrator
NewMigrator returns a migrator instance
func (*Migrator) MigrateAffiliationsTable ¶
MigrateAffiliationsTable is responsible for migrating affiliations table SQLite has limited support for altering table columns, to upgrade the schema we require renaming the current affiliations table to affiliations_old and then creating a new user table using the new schema definition. Next, we proceed to copy the data from the old table to new table, and then drop the old table.
func (*Migrator) MigrateCertificatesTable ¶
MigrateCertificatesTable is responsible for migrating certificates table SQLite has limited support for altering table columns, to upgrade the schema we require renaming the current certificates table to certificates_old and then creating a new certificates table using the new schema definition. Next, we proceed to copy the data from the old table to new table, and then drop the old table.
func (*Migrator) MigrateCredentialsTable ¶
MigrateCredentialsTable is responsible for migrating credentials table
func (*Migrator) MigrateNoncesTable ¶
MigrateNoncesTable is responsible for migrating nonces table
func (*Migrator) MigrateRAInfoTable ¶
MigrateRAInfoTable is responsible for migrating rainfo table
func (*Migrator) MigrateUsersTable ¶
MigrateUsersTable is responsible for migrating users table