diff --git a/database/migrations/mysql/02-remove-onloan.sql b/database/migrations/mysql/02-remove-onloan.sql new file mode 100644 index 0000000..b6b931e --- /dev/null +++ b/database/migrations/mysql/02-remove-onloan.sql @@ -0,0 +1 @@ +ALTER TABLE books DROP COLUMN onloan; \ No newline at end of file diff --git a/database/mysql.go b/database/mysql.go index 0bd2a40..350dc90 100644 --- a/database/mysql.go +++ b/database/mysql.go @@ -155,7 +155,7 @@ func (m *MySQL) GetAllBooks(ctx context.Context) ([]media.Book, error) { allBooksQuery := fmt.Sprintf(`SELECT id, title, authors, sortauthor, isbn10, isbn13, format, genre, publisher, series, volume, year, signed, - description, notes, onloan, coverurl + description, notes, coverurl FROM %s`, m.tableName) books := []media.Book{} @@ -174,7 +174,7 @@ func (m *MySQL) GetAllBooks(ctx context.Context) ([]media.Book, error) { &b.Format, &b.Genre, &b.Publisher, &b.Series, &b.Volume, &b.Year, &b.Signed, &b.Description, &b.Notes, - &b.OnLoan, &b.CoverURL) + &b.CoverURL) if err != nil { return nil, err } @@ -192,9 +192,9 @@ func (m *MySQL) AddBook(ctx context.Context, b *media.Book) error { res, err := m.connection.ExecContext(ctx, ` INSERT INTO `+m.tableName+` - (title, authors, sortauthor, isbn10, isbn13, format, genre, publisher, series, volume, year, signed, description, notes, onloan, coverurl) + (title, authors, sortauthor, isbn10, isbn13, format, genre, publisher, series, volume, year, signed, description, notes, coverurl) VALUES - (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, b.Title, strings.Join(b.Authors, ";"), b.SortAuthor, @@ -209,7 +209,6 @@ func (m *MySQL) AddBook(ctx context.Context, b *media.Book) error { b.Signed, b.Description, b.Notes, - b.OnLoan, b.CoverURL, ) if err != nil { @@ -250,7 +249,6 @@ func (m *MySQL) UpdateBook(ctx context.Context, old, new *media.Book) error { signed=? description=? notes=? - onloan=? coverurl=? WHERE id=?`, new.Title, @@ -267,7 +265,6 @@ func (m *MySQL) UpdateBook(ctx context.Context, old, new *media.Book) error { new.Signed, new.Description, new.Notes, - new.OnLoan, new.CoverURL, old.ID) if err != nil { diff --git a/frontend/files/app.js b/frontend/files/app.js index f218913..bfe23a0 100644 --- a/frontend/files/app.js +++ b/frontend/files/app.js @@ -127,7 +127,6 @@ function BookTemplate({ description, format, notes, - onLoan, publisher, series, signed, @@ -136,7 +135,7 @@ function BookTemplate({ year, }) { return `${coverURL ? `` : ""} -
${description}
${notes ? `Notes:${notes}
` : ""} @@ -157,14 +155,13 @@ function BookTemplate({ function TableRowTemplate({ "isbn-13": isbn13, authors, - onLoan, publisher, rowNumber, signed, title, year, }) { - return `