<<EOS
CREATE TABLE Books (
id INTEGER PRIMARY KEY,
+ arrived TIMESTAMP,
author INTEGER REFERENCES Authors(id),
classification INTEGER REFERENCES Classifications(id),
cover INTEGER,
end
def store_book(book)
- sql = "INSERT INTO Books (id, author, classification, cover, description, language, path, series, title, volume) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);"
+ sql = "INSERT INTO Books (id, arrived, author, classification, cover, description, language, path, series, title, volume) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);"
book_id = next_id('book_id')
author_id = store_author(book.author)
(efs_id, mime_type) = store_cover(book)
- args = [book_id, author_id, book.classification_id, efs_id, book.description, book.language, book.path, book.series_id, book.title, book.volume]
+ args = [book_id, book.arrived, author_id, book.classification_id, efs_id, book.description, book.language, book.path, book.series_id, book.title, book.volume]
begin
rs = @conn.exec_params(sql, args)