copilot_work_3 / infra /bigquery_schema.sql
Suchinthana Wijesundara
Init commit with project codes
f64a3bf
Raw History Blame
650 Bytes
CREATE TABLE IF NOT EXISTS `YOUR_PROJECT_ID.YOUR_DATASET.tools` (
tool_id STRING NOT NULL,
slug STRING NOT NULL,
name STRING NOT NULL,
summary STRING NOT NULL,
category STRING NOT NULL,
repo_url STRING NOT NULL,
website_url STRING,
submitted_by STRING NOT NULL,
created_at TIMESTAMP NOT NULL
)
PARTITION BY DATE(created_at)
CLUSTER BY category, slug;
CREATE TABLE IF NOT EXISTS `YOUR_PROJECT_ID.YOUR_DATASET.tool_ratings` (
tool_id STRING NOT NULL,
voter_id STRING NOT NULL,
rating INT64 NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
)
PARTITION BY DATE(created_at)
CLUSTER BY tool_id, voter_id;