Integrate users and books
- new table userbook linking users and book - moved rating to users book - updated demo data and tests - updated front to hide routes from non connected users
This commit is contained in:
@@ -20,6 +20,7 @@ func Initdb(databasePath string, demoDataPath string) *gorm.DB {
|
||||
// Migrate the schema
|
||||
db.AutoMigrate(&model.Book{})
|
||||
db.AutoMigrate(&model.User{})
|
||||
db.AutoMigrate(&model.UserBook{})
|
||||
var book model.Book
|
||||
queryResult := db.Limit(1).Find(&book)
|
||||
if queryResult.RowsAffected == 0 && demoDataPath != "" {
|
||||
|
||||
Reference in New Issue
Block a user