@@ -28,6 +28,7 @@ DROP TABLE IF EXISTS countries CASCADE;
2828DROP TABLE IF EXISTS events CASCADE;
2929DROP VIEW IF EXISTS tag_usage;
3030DROP TABLE IF EXISTS products CASCADE;
31+ DROP TABLE IF EXISTS barcodes CASCADE;
3132
3233--
3334-- Enables the Postgis extension
@@ -141,6 +142,17 @@ CREATE TABLE products (
141142 deleted_at timestamp NULL
142143);
143144
145+ --
146+ -- Name: barcodes; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
147+ --
148+
149+ CREATE TABLE barcodes (
150+ id serial NOT NULL ,
151+ product_id integer NOT NULL ,
152+ hex character varying (255 ) NOT NULL ,
153+ bin bytea NOT NULL
154+ );
155+
144156--
145157-- Data for Name: categories; Type: TABLE DATA; Schema: public; Owner: postgres
146158--
@@ -209,12 +221,19 @@ INSERT INTO "events" ("name", "datetime", "visitors") VALUES
209221(' Launch' , ' 2016-01-01 13:01:01' , 0 );
210222
211223--
212- -- Data for Name: events ; Type: TABLE DATA; Schema: public; Owner: postgres
224+ -- Data for Name: products ; Type: TABLE DATA; Schema: public; Owner: postgres
213225--
214226
215227INSERT INTO " products" (" name" , " price" , " properties" , " created_at" ) VALUES
216228(' Calculator' , ' 23.01' , ' {"depth":false,"model":"TRX-120","width":100,"height":null}' , ' 1970-01-01 01:01:01' );
217229
230+ --
231+ -- Data for Name: barcodes; Type: TABLE DATA; Schema: public; Owner: postgres
232+ --
233+
234+ INSERT INTO " barcodes" (" product_id" , " hex" , " bin" ) VALUES
235+ (1 , ' 00ff01' , E' \\ x00ff01' );
236+
218237--
219238-- Name: categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
220239--
@@ -294,6 +313,14 @@ ALTER TABLE ONLY products
294313 ADD CONSTRAINT products_pkey PRIMARY KEY (id);
295314
296315
316+ --
317+ -- Name: barcodes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
318+ --
319+
320+ ALTER TABLE ONLY barcodes
321+ ADD CONSTRAINT barcodes_pkey PRIMARY KEY (id);
322+
323+
297324--
298325-- Name: comments_post_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
299326--
@@ -329,6 +356,13 @@ CREATE INDEX posts_category_id_idx ON posts USING btree (category_id);
329356CREATE INDEX posts_user_id_idx ON posts USING btree (user_id);
330357
331358
359+ --
360+ -- Name: barcodes_product_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
361+ --
362+
363+ CREATE INDEX barcodes_product_id_idx ON barcodes USING btree (product_id);
364+
365+
332366--
333367-- Name: comments_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
334368--
@@ -369,6 +403,14 @@ ALTER TABLE ONLY posts
369403 ADD CONSTRAINT posts_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
370404
371405
406+ --
407+ -- Name: barcodes_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
408+ --
409+
410+ ALTER TABLE ONLY barcodes
411+ ADD CONSTRAINT barcodes_product_id_fkey FOREIGN KEY (product_id) REFERENCES products(id);
412+
413+
372414--
373415-- PostgreSQL database dump complete
374416--
0 commit comments