mirror of
https://github.com/docker/docs.git
synced 2026-04-12 14:25:46 +07:00
Merge pull request #767 from docker/rethinkdb-export-schema
Export rethinkdb table definitions
This commit is contained in:
@@ -269,8 +269,8 @@ func (rdb RethinkDB) deleteByTSChecksum(tsChecksum string) error {
|
||||
// Bootstrap sets up the database and tables, also creating the notary server user with appropriate db permission
|
||||
func (rdb RethinkDB) Bootstrap() error {
|
||||
if err := rethinkdb.SetupDB(rdb.sess, rdb.dbName, []rethinkdb.Table{
|
||||
tufFiles,
|
||||
keys,
|
||||
TufFilesRethinkTable,
|
||||
PubKeysRethinkTable,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
tufFiles = rethinkdb.Table{
|
||||
// TufFilesRethinkTable is the table definition of notary server's TUF metadata files
|
||||
TufFilesRethinkTable = rethinkdb.Table{
|
||||
Name: RDBTUFFile{}.TableName(),
|
||||
PrimaryKey: "gun_role_version",
|
||||
SecondaryIndexes: map[string][]string{
|
||||
@@ -28,7 +29,8 @@ var (
|
||||
},
|
||||
}
|
||||
|
||||
keys = rethinkdb.Table{
|
||||
// PubKeysRethinkTable is the table definition of notary server's public key information for TUF roles
|
||||
PubKeysRethinkTable = rethinkdb.Table{
|
||||
Name: RDBKey{}.TableName(),
|
||||
PrimaryKey: "id",
|
||||
SecondaryIndexes: map[string][]string{
|
||||
|
||||
@@ -39,7 +39,8 @@ type RDBPrivateKey struct {
|
||||
Private string `gorethink:"private"`
|
||||
}
|
||||
|
||||
var privateKeys = rethinkdb.Table{
|
||||
// PrivateKeysRethinkTable is the table definition for notary signer's key information
|
||||
var PrivateKeysRethinkTable = rethinkdb.Table{
|
||||
Name: RDBPrivateKey{}.TableName(),
|
||||
PrimaryKey: RDBPrivateKey{}.KeyID,
|
||||
}
|
||||
@@ -243,7 +244,7 @@ func (rdb RethinkDBKeyStore) ExportKey(keyID string) ([]byte, error) {
|
||||
// Bootstrap sets up the database and tables, also creating the notary signer user with appropriate db permission
|
||||
func (rdb RethinkDBKeyStore) Bootstrap() error {
|
||||
if err := rethinkdb.SetupDB(rdb.sess, rdb.dbName, []rethinkdb.Table{
|
||||
privateKeys,
|
||||
PrivateKeysRethinkTable,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user