1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00

NOISSUE - remove owner id from user table and object (#1303)

* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
This commit is contained in:
Mirko Teodorovic 2020-12-15 15:57:37 +01:00 committed by GitHub
parent 9864b27271
commit 18dd8967cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 6 deletions

View File

@ -94,8 +94,6 @@ func migrateDB(db *sqlx.DB) error {
FOREIGN KEY (group_id) REFERENCES groups (id) ON DELETE CASCADE ON UPDATE CASCADE,
PRIMARY KEY (user_id, group_id)
)`,
`ALTER TABLE IF EXISTS users ADD COLUMN IF NOT EXISTS owner_id UUID`,
`ALTER TABLE IF EXISTS users ADD FOREIGN KEY (owner_id) REFERENCES groups(id)`,
},
},
},

View File

@ -325,7 +325,6 @@ func (m dbMetadata) Value() (driver.Value, error) {
type dbUser struct {
ID string `db:"id"`
Owner string `db:"owner"`
Email string `db:"email"`
Password string `db:"password"`
Metadata []byte `db:"metadata"`

View File

@ -38,9 +38,6 @@ type User struct {
ID string
Email string
Password string
OwnerID string
Owner *User
Groups []Group
Metadata Metadata
}