Snowflake

AIRSHIP MAINTAINED INTEGRATION

This integration is maintained by Airship. Please contact Airship for support.

Snowflake is a fully managed cloud-based data warehouse and analytics service for storing and analyzing data. Snowflake works with the three major cloud providers and supports fully structured as well as semi-structured data.

With this integration, Airship event data is uploaded in batched CSV files to a cloud storage provider that can be configured as a Snowflake stage. Airship provides event schemas for tables that correspond to each Airship event type to make it easy to load and query your data. You are responsible for creating a data pipeline to load the Airship events into your Snowflake warehouse. How frequently you copy the data into Snowflake is up to you and can depend on your use case.

Snowflake integration requirements

This integration requires these accounts:

  1. Snowflake
  2. Airship — Must include both:

Configuring a cloud storage provider

This connection point takes Airship event data and sends it to a cloud storage destination in either Amazon S3, Azure Blob Storage, or Google Cloud Storage (GCS).

Before you can set up your connection point, you must create an Amazon S3 bucket, a Google Google Cloud Storage bucket, or a Microsoft Azure container. You will then create access credentials that the integration will use to upload data to the storage location.

Configuring the Snowflake integration

You will need the following information about your cloud storage:

  • Amazon S3 — Access key ID, secret access key, and bucket name, and AWS Region
  • Azure — Connection string and container name
  • Google Cloud Storage — Private key and bucket name

In Airship:

  1. Go to Settings.
  2. Under Project Configuration, select Manage for Real-Time Data Streaming.
  3. Under Real-Time Data Streaming, select Snowflake.
  4. Follow the onscreen instructions to configure the integration. You have the option to compress your data to save on storage space. If using Amazon S3 for storage, you also have the option to encrypt your data using server-side encryption.

It may take several minutes to begin populating events.

Configuring a Snowflake external stage

See Snowflake documentation for steps to configure your cloud storage bucket as an external stage.

Creating Airship tables in Snowflake

Now you are ready to create a database and tables for your Airship data in Snowflake. A sample setup script and event schemas are provided below.

Loading data in Snowflake

After your data has been staged, copy your data into the Airship event tables. This can be a step in your data pipeline. You will determine which data and how frequently you want to copy events to Snowflake tables.

use "DB_NAME"."AIRSHIP_EVENTS";

copy into "TAG_CHANGE"
    from @sample_airship_stage
    //validation_mode = RETURN_ERRORS
    file_format = airship_csv_events
    pattern = 'ISex_TTJRuarzs9-o_Gkhg/gcs/19c15b67-1dd5-46b9-a25a-dfbd5d60ce58/TAG_CHANGE/2022_03_31/.*[.]csv'; //[.]gz

Structure and files

Your cloud storage directory structure and files will be named using this CSV pattern:

appKey + “/” + cloud provider + “/” + integrationId + “/EVENT_TYPE/” + year + “_” + month + “_” + day + “/” + year + “_” + month + “_” + day + “_” + hour + “_” + minute + “_” + second + “.csv”

There will be one file generated per hour, assuming a relevant event occurred within that hour. Each CSV file will also contain a header row.

Example CSV

"id","offset","occurred","processed","app_key","channel","device_type","named_user","custom_identifiers","locale_variant","locale_country_code","locale_timezone","locale_language_code","iana_timezone","app_version","device_model","connection_type","ua_sdk_version","push_opt_in","device_os","carrier","location_enabled","location_permission","background_push_enabled","web_browser_name","web_browser_type","web_browser_version","web_user_agent_string","open_platform_name","alerting","campaigns","push_id","group_id","variant_id"
"f5e05251-b128-11ec-8a12-0242eb00e5a9","1000042149690","2022-03-31 19:30:02.357 +00:00","2022-03-31 19:30:14.867 +00:00","ISex_TTJRuarzs9-o_Gkhg","b1ab9a9e-9634-4fb4-875a-9a02dcd68e66","ANDROID","","","","FR","7200","fr","Europe/Paris","2022-02-09T000134-goat","VOG-L29","CELL","16.3.0","true","10","F SFR","false","NOT_ALLOWED","true","","","","","","true","","f5d2bdc0-b128-11ec-bae4-024205acadbe","ac4058f7-981b-4f0e-b9c4-8b7af3a647da",""
"f8fb4df1-b128-11ec-a0e3-0242e24c72c5","1000042149691","2022-03-31 19:30:07.567 +00:00","2022-03-31 19:30:16.760 +00:00","ISex_TTJRuarzs9-o_Gkhg","b1ab9a9e-9634-4fb4-875a-9a02dcd68e66","ANDROID","","","","FR","7200","fr","Europe/Paris","2022-02-09T000134-goat","VOG-L29","CELL","16.3.0","true","10","F SFR","false","NOT_ALLOWED","true","","","","","","true","","f6586880-b128-11ec-99dd-02423b3f5d45","879056c8-0b34-4c8c-8cdc-1df4f3d40b40",""
"9aa98182-e854-4fa7-9c9f-ddea2082cc4c","1000042149694","2022-03-31 19:33:51.225 +00:00","2022-03-31 19:33:51.416 +00:00","ISex_TTJRuarzs9-o_Gkhg","62d92a24-0ced-40d1-ad1d-e1ea953189b7","SMS","","{""sender"":""17372004196""}","","","","","","","","","","","","","","","","","","","","","true","","75fdde30-b129-11ec-99dd-02423b3f5d45","0e2a3d4b-b4b4-4208-838f-08eb7333aa5e",""

Sample Snowflake file format

create or replace file format airship_csv_events
  type = csv 
  skip_header = 1
  timestamp_format = 'AUTO' //YYYY-MM-DD HH24:MI:SS.FF TZH:TZM 
  null_if = '' 
  field_optionally_enclosed_by='"'
  error_on_column_count_mismatch=false
  field_delimiter = ",";

Sample Airship setup script and event schemas

create schema if not exists "AIRSHIP_EVENTS";

use "DB_NAME"."AIRSHIP_EVENTS";

create table if not exists "ATTRIBUTE_OPERATION" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "attribute_set" variant comment 'The attributes set on the device as an array of attribute objects.',
    "attribute_remove" variant comment 'The attributes removed from the device as an array of attribute objects.'
) comment = 'Attribute Operation events indicate a change in the device''s attributes. Because attribute operations are related to a device, they will have a `device` field. If you set an attribute on a named user, Airship records events for each device associated with the named user.';

create table if not exists "IN_APP_MESSAGE_DISPLAY" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Message was created by t if not existshe application logic, not the UA system. If this field is present, the event body will not contain `push_id`, `group_id`,  `variant_id`, or `triggering_push` fields.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.'
) comment = 'Occurs when an in-app message is displayed to a user. Because the event pertains to a specific device, the device information object will be populated.';

create table if not exists "FIRST_OPEN" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.'
) comment = 'This event occurs when a user opens an Airship-integrated app for the first time.';

create table if not exists "FIRST_OPT_IN" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "delivery_address" varchar comment 'The address of the device.',
    "open_platform_name" varchar comment 'If device_type is set to OPEN, this field shows the full name of the platform.'
) comment = 'This event appears in the stream when a channel is first opted in. This event is specific to email (commercial), sms and open channels.';

create table if not exists "IN_APP_MESSAGE_RESOLUTION" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Message was created by the application logic, not the UA system. If this field is present, the event body will not contain `push_id`, `group_id`,  `variant_id`, or `triggering_push` fields.',
    "button_description" varchar comment 'The title of the button the user interacted with. Present if `type` is set to `BUTTON_CLICK`.',
    "button_group" varchar comment 'A category associated with the button. Present if `type` is set to `BUTTON_CLICK`.',
    "button_id" varchar comment 'A unique identifier for the button. Present if `type` is set to `BUTTON_CLICK`.',
    "duration" varchar comment 'The number of milliseconds that the user was on the screen.',
    "time_sent" timestamp_tz comment 'The date-time when the in-app message payload was sent to the device.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "resolution_type" varchar comment 'Indicates how the In-App Message was resolved.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.'
) comment = 'Occurs when an In-App Message is cleared from the display, either by user action or timeout. Because this event pertains to an individual device, the device information object will be present.';

create table if not exists "IN_APP_MESSAGE_EXPIRATION" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Message was created by the application logic, not the UA system. If this field is present, the event body will not contain `push_id`, `group_id`,  `variant_id`, or `triggering_push` fields.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "replacing_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "replacing_push_group_id" varchar comment 'The specific group_id associated with the new message.',
    "replacing_push_push_id" varchar comment 'The specific push_id associated with the new message.',
    "replacing_push_variant_id" varchar comment 'The specific variant_id associated with the new message.',
    "replacing_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "time_expired" timestamp_tz comment 'The date-time when the in-app message payload expires.',
    "time_sent" timestamp_tz comment 'The date-time when the in-app message payload was sent to the device.',
    "expiration_type" varchar comment 'Indicates how the in-app message expired.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a new message has taken the place of another message, a message has passed its expiration, or because displaying the message in-app would be redundant. This event type may be latent; it is not emitted until the app becomes active.';

create table if not exists "MOBILE_ORIGINATED" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "delivery_address" varchar comment 'The address of the device.',
    "msisdn" varchar comment 'The mobile number of the device.',
    "sender" varchar comment 'The email address or number of the sender.',
    "keyword" varchar comment 'The specific keyword used in the inbound message, if recognized; the keyword in the inbound_message determines the outbound_message sent to the device. If a keyword could not be matched in the inbound_message, this field is absent.',
    "inbound_message" varchar comment 'The contents of the message received from an SMS device.',
    "outbound_message" varchar comment 'The response sent to the SMS device, based on the inbound message and keyword.'
) comment = 'Represents a message action that originated from a user — like an inbound SMS or email.';

create table if not exists "OPEN" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "last_delivered_push_id" varchar comment 'Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago.',
    "last_delivered_group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "last_delivered_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "last_delivered_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "last_delivered_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a user opens your app.';

create table if not exists "RICH_DELETE" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a user deletes a rich message from their inbox.';

create table if not exists "PUSH_BODY" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "trimmed" boolean comment 'If true, the push payload was trimmed from the event body.',
    "resource" varchar comment 'Describes the type of push, helping you interpret the JSON response. Possible values: PIPELINES, SCHEDULES, PUSH, EXPERIMENTS, IN_APP_AUTOMATION',
    "payload" varchar comment 'The specification of the push as sent via the API, a Base64 encoded JSON value.'
) comment = 'Occurs when you initiate a push, automation, or sequence.Airship fulfills delivery over a time interval with a number of child pushes, each with a unique Push ID and a common Group ID. There is no guarantee that push body events (defined in Push Body Event) for the child pushes fulfilling a group will appear in the stream.**Note:** When you start, pause, or publish a sequence, Airship emits a `push_body` event for the sequence itself, and each message contained within the sequence (i.e. messages +1). After you start a sequence, Airship does not issue subsequent `push_body` events for the sequence unless you pause or publish changes to the sequence.';

create table if not exists "RICH_DELIVERY" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a rich message is delivered to a user''s inbox.Even though rich push deliveries may or may not cause an alert on the user’s lock screen, they are always associated with a push identifier in the Airship system.';

create table if not exists "REGION" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "action" varchar comment 'Indicates whether the event was the result of a user entering or exiting the region.',
    "name" varchar comment 'A friendly name for the region; may be retrieved from a third-party location provider.  ',
    "region_id" varchar comment 'A unique identifier for the region in Airship, UUID format.',
    "source_info_source" varchar comment 'Information about the source application that generated the event.',
    "source_info_region_id" varchar comment 'The unique region identifier from the originating system or location provider.'
) comment = 'Region Events are emitted when a device enters or exits a geofence or the range of any of a set of bluetooth beacons. Region events require a Gimbal integration. Events for Gimbal customers include the Gimbal application instance identifer as `com.urbanairship.gimbal.aii` within the `identifiers` object.';

create table if not exists "SCREEN_VIEWED" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "duration" varchar comment 'The number of milliseconds that the user was on the screen.',
    "viewed_screen" varchar comment 'The name assigned to the screen that the user left.',
    "previous_screen" varchar comment 'The name assigned to the screen the user was on prior to the viewed screen.'
) comment = 'Occurs when a user has finished viewing a screen. It is up to you to instrument your application with names for each screen. Doing so will allow you to deterimine the user’s path by filtering on the fields in the table below.';

create table if not exists "SEND" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "open_platform_name" varchar comment 'If device_type is set to OPEN, this field shows the full name of the platform.',
    "alerting" boolean comment 'If true, the send event was alerting. Alerting send event has notification text, badge, or sound.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "context_triggered_by" varchar comment 'The triggering event type.',
    "context_event_uuid" varchar comment 'The ID of the custom event which triggered the send.',
    "context_interaction_id" varchar comment 'If interaction_id was set on the custom event body, it will be populated here.',
    "context_transaction" varchar comment 'If transaction was set on the custom event body, it will be populated here.'
) comment = 'Occurs whenever a push notification is sent to a device identified in the audience selector of a message.';

create table if not exists "SHORT_LINK_CLICK" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "original_url" varchar comment 'The URL that was clicked.',
    "delivery_address" varchar comment 'The address of the device.',
    "sender" varchar comment 'The email address or number of the sender.'
) comment = 'Occurs when a user taps or "clicks" an Airship-shortened link in an SMS or MMS message.';

create table if not exists "SEND_ABORTED" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "reason" varchar comment 'Describes the reason this push was aborted.'
) comment = 'Occurs when a push is dropped from our system before delivery is attempted. This can happen if you are using[External Data Feeds](../../guides/messaging/user-guide/personalization/sources/external-data-feeds/)to personalize a message and an error was encountered or the feed returned a non-successful response, or when reaching a [Message Limit](../../guides/messaging/user-guide/project/config/message-limits/index.html).Device information for the device that did not receive the push is included with `SEND_ABORTED` events.';

create table if not exists "UNINSTALL" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "decay" boolean comment 'If true, Airship recorded an uninstall event due to user inactivity.'
) comment = 'Occurs when a user uninstalls an Airship-integrated app in response to a push.';

create table if not exists "CONTROL" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.'
) comment = 'Occurs when a device is excluded from a push because it was arbitrarily selected as a member of a control group. Membership in a control group indicates what would''ve happened if you did not send a message to a user at all. This occurs for A/B Test-related pushes only.';

create table if not exists "RICH_READ" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a user reads a rich message in their inbox.';

create table if not exists "TAG_CHANGE" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "tags_add" variant comment 'Tag group/tag pairs added to the device. Each tag group is an array containing one or more tags within this object.',
    "tags_current" variant comment 'The total set/state of tag group/tag pairs associated with the device after the tag change. Each tag group is an array containing one or more tags within this object.',
    "tags_remove" variant comment 'Tag group/tag pairs removed from the device. Each tag group is an array containing one or more tags within this object.'
) comment = 'Occurs when tags change for a device.';

create table if not exists "CLOSE" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.'
) comment = 'Occurs when a user closes the app. Close events are often latent, as they aren''t sent back to Airship until the user activates the app again.';

create table if not exists "SEND_REJECTED" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.'
) comment = 'Occurs when a push fails during communication with a third party, like APNs or GCM. This typically indicates that the user has uninstalled the app or otherwise invalidated the last-registered credentials stored in Airship. The event contains the rejected push and the group, variant, or campaigns the push belonged to.Device information for the device that did not receive the push is included with `SEND_REJECTED` events.';

create table if not exists "WEB_SESSION" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "last_delivered_push_id" varchar comment 'Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago.',
    "last_delivered_group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "last_delivered_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "last_delivered_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "last_delivered_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.'
) comment = 'Occurs when an opted in user begins interacting with a website. Web Session events have a device attribute, indicating the channel associated with the user.';

create table if not exists "WEB_CLICK" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a user interacts with a web notification, e.g., clicked or tapped it. Web Click events have a device attribute on the event indicating the channel that was the target of the notification. The body of a Web Click Event is an Associated Push object.';

create table if not exists "CUSTOM" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar comment 'The unique, platform-agnostic channel identifier for a device. Can be null if the event was sent to a named user.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "web_browser_name" varchar comment 'The name of the browser running the SDK.',
    "web_browser_type" varchar comment 'Indicates whether the browser was running on a desktop or mobile device.',
    "web_browser_version" varchar comment 'The version of the browser running the SDK.',
    "web_user_agent_string" varchar comment 'The user agent string reported by the browser.',
    "name" varchar comment 'The name of the event.',
    "properties" variant comment 'A JSON object containing the properties of the event.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "value" number comment 'Populated if the event is associated with a count or amount. Airship treats this field as a representation of money. The `value` field respects six digits of precision to the right of the decimal point.',
    "source" varchar comment 'The source of the event either API or SDK.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "last_delivered_push_id" varchar comment 'Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago.',
    "last_delivered_group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "last_delivered_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "last_delivered_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "last_delivered_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Represents custom events that are either emitted from the Airship SDK or submitted through the Custom Events API. You can configure custom events yourself. There are also several CUSTOM-type events for email and SMS that are defined by Airship.In general, you can expect device information if the event source is `SDK` or if the event is one of the defined email or SMS events (as defined by `event_type`).';

create table if not exists "SUBSCRIPTION" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "delivery_address" varchar comment 'The address of the device.',
    "subscription_event_type" varchar comment 'Determines the source of the subscription event. registration and create_and_s if not existsend events result in changes to opted_in dates; all other event types contain opted_out dates.',
    "subscription_identifiers_address" varchar comment 'The email address representing the change.',
    "commercial_opted_in" timestamp_tz comment 'The date and time when the address opted into commercial email messages.',
    "transactional_opted_in" timestamp_tz comment 'The date and time when the address opted into transactional email messages.'
) comment = 'Reflect changes to users'' subscription preferences — reflected in opt_in and opt_out values. These events help you track a user''s subscription status in the system and the total number of subscribers.';

create table if not exists "IN_APP_BUTTON_TAP" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Button Tap was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "button_id" varchar comment 'A unique identifier for the button.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "rendered_locale" varchar comment 'Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when an in-app button is tapped within a scene or survey.';

create table if not exists "IN_APP_EXPERIENCES" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Message was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "event_name" varchar comment 'Name of the experiences event. Possible values: scene_displayed, scene_completed, scene_incomplete, survey_displayed, survey_submitted, survey_not_submitted.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "survey_type" varchar comment 'The survey type, only present for survey events. Possible values: nps, user_feedback.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Events that occur related to the display and completion behavior of a scene or survey.';

create table if not exists "IN_APP_FORM_DISPLAY" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Form was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "forms" variant comment 'Information about the forms.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "in_app_form_event_type" varchar comment 'The In-App Form event type. The value is always DISPLAY.'
) comment = 'Occurs when an in-app form (currently specific to surveys) is displayed.';

create table if not exists "IN_APP_FORM_RESULT" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Form was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "forms" variant comment 'Information about the forms.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "in_app_form_event_type" varchar comment 'The In-App Form event type. The value is always RESULT.'
) comment = 'Occurs when an in-app form (currently specific to surveys) is submitted.';

create table if not exists "IN_APP_PAGE_SWIPE" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Pager was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "from_page_index" number comment 'The previous page index',
    "from_page_identifier" varchar comment 'The previous page identifier.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "rendered_locale" varchar comment 'Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to.',
    "pager_identifier" varchar comment 'The pager controller identifier.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "to_page_identifier" varchar comment 'The current page identifier',
    "to_page_index" number comment 'The current page index',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when a user swipes to the next or previous page (screen) in a pager (currently specific to Scenes).';

create table if not exists "IN_APP_PAGE_VIEW" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Pager was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "completed" boolean comment 'Whether the user has reached the end of the pager.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "rendered_locale" varchar comment 'Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to.',
    "page_count" number comment 'The total number of pages.',
    "page_identifier" varchar comment 'The current page identifier.',
    "page_index" number comment 'The current pager index.',
    "pager_identifier" varchar comment 'The pager controller identifier.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "viewed_count" number comment 'The number of times the current page has been viewed.'
) comment = 'Occurs when a page (screen) is displayed within a pager (currently specific to Scenes & Surveys).';

create table if not exists "IN_APP_PAGER_COMPLETED" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Pager was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "rendered_locale" varchar comment 'Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to.',
    "page_count" number comment 'The total number of pages.',
    "page_identifier" varchar comment 'The current page identifier.',
    "page_index" number comment 'The current pager index.',
    "pager_identifier" varchar comment 'The pager controller identifier.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
) comment = 'Occurs when the last page (screen) of a pager is viewed for the first time (currently specific to Scenes & Surveys).';

create table if not exists "IN_APP_PAGER_SUMMARY" (
    "id" varchar unique not null comment 'The event ID',
    "offset" varchar comment 'The offset of the event that represents the location of the event in the stream.',
    "occurred" timestamp_tz comment 'The time the event occurred.',
    "processed" timestamp_tz comment 'The time the event was processed.',
    "app_key" varchar comment 'The identifier for the Airship project.',
    "channel" varchar not null comment 'The unique, platform-agnostic channel identifier for a device.',
    "device_type" varchar comment 'The platform of the channel',
    "named_user" varchar comment 'The named user identifier associated with the channel.',
    "custom_identifiers" variant comment 'The custom identifiers associated with the app channel, stored as an object.',
    "locale_variant" varchar comment 'The language variant as reported by the device.',
    "locale_country_code" varchar comment 'The ISO 3166-1 country code as defined in device settings.',
    "locale_timezone" varchar comment 'The timezone as reported by the device offset in seconds from UTC.',
    "locale_language_code" varchar comment 'The ISO 639-1 two-letter language code as defined in device settings.',
    "iana_timezone" varchar comment 'The IANA timezone of the device.',
    "app_version" varchar comment 'The version of the app installed on the device.',
    "device_model" varchar comment 'The model of the device.',
    "connection_type" varchar comment 'The internet connection type used by the device.',
    "ua_sdk_version" varchar comment 'The version of the Airship SDK used to record the event.',
    "push_opt_in" boolean comment 'Whether the user has opted in to push notifications.',
    "device_os" varchar comment 'The operating system of the device.',
    "carrier" varchar comment 'The wireless carrier used by the device.',
    "location_enabled" boolean comment 'Whether the device has location services enabled.',
    "location_permission" varchar comment 'Location permission level as configured in device settings.',
    "background_push_enabled" boolean comment 'Whether the device has background push notifications enabled.',
    "app_defined_id" varchar comment 'An identifier defined by the application if the In-App Pager was created by the application logic, not the UA system. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields.',
    "context_reporting_context_content_types" variant comment 'The content types of the in-app automation.',
    "context_state_form_form_identifier" varchar comment 'Is the form controller identifier.',
    "context_state_form_response_type" varchar comment 'The form response type. Possible values: nps, user_feedback.',
    "context_state_form_submitted" boolean comment 'Whether the form has been submitted.',
    "context_state_form_type" varchar comment 'The form type. Possible values: nps, form.',
    "context_state_pager_completed" boolean comment 'Whether the user reached the end of the pager.',
    "context_state_pager_identifier" varchar comment 'The pager controller identifier.',
    "context_state_pager_page_count" number comment 'The total number of pages.',
    "context_state_pager_page_identifier" varchar comment 'The current page identifier.',
    "context_state_pager_page_index" number comment 'The current pager index.',
    "completed" boolean comment 'Whether the user has reached the end of the pager.',
    "group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.',
    "rendered_locale" varchar comment 'Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to.',
    "page_count" number comment 'The total number of pages.',
    "page_identifier" varchar comment 'The current page identifier.',
    "pager_identifier" varchar comment 'The pager controller identifier.',
    "push_id" varchar comment 'A unique identifier for a push operation.',
    "session_id" varchar comment 'Represents the “session” of user activity. Absent if the application was initialized while backgrounded.',
    "time_sent" timestamp_tz comment 'An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device.',
    "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.',
    "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s',
    "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.',
    "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.',
    "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).',
    "viewed_pages" variant comment 'Information about each viewed page.'
) comment = 'Describes the full path a user took within a pager (currently specific to Scenes and Surveys), including the order of pages (screens) visited and time spent per page.';

show tables;

Schema and file changes

Airship may occasionally add additional columns to the exported CSV files. Column order will remain the same and any new columns will be appended. When creating your data pipelines we recommend ignoring additional columns to prevent any additions from breaking your data loads. If you encounter data load errors, you can recover from your staged files to ensure that no Airship event data is lost.

Changes will be noted in the changelog along with example migrations.

Changelog

ChangeMigration
May 2023
Make channel ID not required for CUSTOM table. Custom events sent to named users will not include a channel ID.
alter table "CUSTOM"
alter "channel" drop not null;
Dec 2022
Added campaigns to IN_APP_MESSAGE_RESOLUTION and IN_APP_MESSAGE_DISPLAY tables.
alter table IN_APP_MESSAGE_RESOLUTION
add column "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.';

alter table IN_APP_MESSAGE_DISPLAY
add column "campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.';
Sep 2022
Added push attributes to CUSTOM table.
alter table CUSTOM
add column "triggering_push_push_id" varchar comment 'The push ID of the push that triggered the custom event.'
add column "triggering_push_group_id" varchar comment 'The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s'
add column "triggering_push_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.'
add column "triggering_push_time" timestamp_tz comment 'The UTC time when the push occurred.'
add column "triggering_push_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).'
add column "last_delivered_push_id" varchar comment 'Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago.'
add column "last_delivered_group_id" varchar comment 'Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.'
add column "last_delivered_campaigns" variant comment 'An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.'
add column "last_delivered_time" timestamp_tz comment 'The UTC time when the push occurred.'
add column "last_delivered_variant_id" varchar comment 'The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).';