Skip to content

Commit

Permalink
Add UNIQUE constraint for barcode
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdienes committed Apr 16, 2024
1 parent 391d03b commit d37529d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module.exports.setupDatabase = function(db) {
db.serialize(() => {
db.run(`CREATE TABLE IF NOT EXISTS Products (
id INTEGER PRIMARY KEY,
barcode TEXT UNIQUE,
name TEXT,
description TEXT,
image_url TEXT,
barcode TEXT
image_url TEXT
)`);

//Consumers may be allergic or have intolerance to other ingredients, but only the 14 allergens are required to be declared as allergens by food law.
Expand Down

0 comments on commit d37529d

Please sign in to comment.