Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add sample_audio_data to make audio testing possible #119

Merged
merged 2 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion load_sample_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ docker-compose exec "$UPSTREAM_DB_SERVICE_NAME" /bin/bash -c "psql -U deploy -d
ALTER TABLE image_view ADD COLUMN standardized_popularity double precision;
CREATE TABLE content_provider(provider_identifier varchar(50), provider_name varchar(250), created_on timestamp, domain_name varchar(500), filter_content boolean, notes text);
INSERT INTO content_provider (created_on, provider_identifier, provider_name, domain_name, filter_content) VALUES (now(), 'flickr', 'Flickr', 'https://www.flickr.com', false), (now(), 'behance', 'Behance', 'https://www.behance.net', false);
\copy image_view (id,created_on,updated_on,identifier,provider,source,foreign_identifier,foreign_landing_url,url,thumbnail,width,height,filesize,license,license_version,creator,creator_url,title,tags_list,last_synced_with_source,removed_from_source,meta_data,tags,watermarked,view_count,standardized_popularity) from './sample_data/sample_data.csv' with csv header
\copy image_view (id,created_on,updated_on,identifier,provider,source,foreign_identifier,foreign_landing_url,url,thumbnail,width,height,filesize,license,license_version,creator,creator_url,title,tags_list,last_synced_with_source,removed_from_source,meta_data,tags,watermarked,view_count,standardized_popularity) from './sample_data/sample_data.csv' with (FORMAT csv, HEADER true)
EOF"

# This is currently added for testing purposes, we can adjust once the audio support is added
#docker-compose exec "$UPSTREAM_DB_SERVICE_NAME" /bin/bash -c "psql -U deploy -d openledger <<-EOF
# CREATE TABLE IF NOT EXISTS audio_view (id serial,identifier uuid,created_on timestamp,updated_on timestamp,ingestion_type varchar(1000),provider varchar(1000),source varchar(1000),foreign_identifier varchar(1000),foreign_landing_url varchar(1000),url varchar(1000),thumbnail varchar(1000),duration integer,bit_rate integer,sample_rate integer,category varchar(1000),genre jsonb,audio_set jsonb,alt_audio_files jsonb,filesize integer,license varchar(1000),license_version varchar(25),creator varchar(1000),creator_url varchar(1000),title varchar(1000),meta_data jsonb,tags jsonb,last_synced_with_source timestamp,removed_from_source boolean,standardized_popularity double precision);
# \copy audio_view (identifier,created_on,updated_on,ingestion_type,provider,source,foreign_identifier,foreign_landing_url,url,thumbnail,duration,bit_rate,sample_rate,category,genre,audio_set,alt_audio_files,filesize,license,license_version,creator,creator_url,title,meta_data,tags,last_synced_with_source,removed_from_source,standardized_popularity) from './sample_data/sample_audio_data.csv' with (FORMAT csv, HEADER true)
# EOF"

# Load search quality assurance data.
curl -XPOST localhost:8001/task -H "Content-Type: application/json" -d '{"model": "image", "action": "LOAD_TEST_DATA"}'
# Ingest and index the data
Expand Down
Loading