Last active
September 1, 2021 09:36
-
-
Save jinagamvasubabu/14dbce3ca89199e083488d80f2d80d64 to your computer and use it in GitHub Desktop.
DDL for apps hierarchy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Enable Ltree | |
create extension if not exists ltree; | |
create table apps_taxonomy ( | |
id integer, | |
name varchar(50), | |
path ltree | |
); | |
create index tree_path_idx on apps_taxonomy using gist (path); | |
insert into apps_taxonomy(id, name, path) values (1, 'Apps', '1'); | |
insert into apps_taxonomy(id, name, path) values (2, 'Messenger', '1.2'); | |
insert into apps_taxonomy(id, name, path) values (3, 'Video streaming', '1.3'); | |
insert into apps_taxonomy(id, name, path) values (4, 'Music streaming', '1.4'); | |
insert into apps_taxonomy(id, name, path) values (5, 'Facebook', '1.2.5'); | |
insert into apps_taxonomy(id, name, path) values (6, 'Instagram', '1.2.6'); | |
insert into apps_taxonomy(id, name, path)values (7, 'Whatsapp', '1.2.7'); | |
insert into apps_taxonomy(id, name, path) values (8, 'Hike', '1.2.8'); | |
insert into apps_taxonomy(id, name, path) values (9,'Telegram', '1.2.9'); | |
insert into apps_taxonomy(id, name, path) values (10,'Youtube', '1.3.10'); | |
insert into apps_taxonomy(id, name, path) values (11,'DailyMotion', '1.3.11'); | |
insert into apps_taxonomy(id, name, path) values (12,'Amazon Prime Video', '1.3.12'); | |
insert into apps_taxonomy(id, name, path) values (13,'Youtube Music', '1.4.13'); | |
insert into apps_taxonomy(id, name, path) values (14,'Amazon Music', '1.4.14'); | |
select * from apps_taxonomy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment