Skip to main content

BigQuery Sync

Column-level detail for the bigquery_sync_config table

Overview

This domain has a single table, bigquery_sync_config, in the public schema (managed by Prisma). It stores the settings for pulling customer summary data from Google BigQuery on a cron schedule, including the service-account credentials, the field mapping, and the result of the last sync run.

Table bigquery_sync_config

ColumnTypeNullableDefaultDescription
idSERIALNOauto incrementPrimary key
line_oa_idINTEGERNO-LINE OA this config belongs to
organization_idINTEGERNO-Owning organization (tenant separation)
project_idVARCHAR(255)NO''Google Cloud project id holding the BigQuery dataset
summary_tableVARCHAR(500)NO''Source BigQuery table read for summary data
user_id_columnVARCHAR(100)NO'user_id'BigQuery column used to match a LINE user
credentialsTEXTYES-Service account credentials (JSON) for BigQuery access
sync_cronVARCHAR(100)NO'0 6 * * *'Cron schedule for the sync run (default 06:00 daily)
field_mappingsJSONBNO'[]'Mapping of BigQuery columns to user attributes
enabledBOOLEANNOfalseWhether automatic syncing is on
last_sync_atTIMESTAMP(3)YES-Timestamp of the last successful sync
last_sync_resultJSONBYES-Last sync outcome, e.g. row counts or error message
statusVARCHAR(20)NO'active'Config record status
created_byINTEGERYES-Creator user id
updated_byINTEGERYES-Last updater user id
created_dateTIMESTAMP(3)YESnow()Creation timestamp
updated_dateTIMESTAMP(3)YESnow()Last update timestamp
deleted_dateTIMESTAMP(3)YES-Soft-delete timestamp

Notes

  • Unique: uq_bigquery_sync_config_org_lineoa on (organization_id, line_oa_id) — one BigQuery sync configuration per LINE OA
  • Index: idx_bigquery_sync_config_org_lineoa on (organization_id, line_oa_id)
  • enabled is deliberately separate from status: status is the lifecycle of the config record, while enabled is the scheduler switch, so syncing can be paused without deleting the config
  • The table has no database-level foreign keys — line_oa_id and organization_id are logical references to line_oa and organization