[
	{
		"name": "echo_push_provider",
		"comment": "Table for normalizing push providers; intended for use with the NameTableStore construct.",
		"columns": [
			{
				"name": "epp_id",
				"type": "mwtinyint",
				"options": { "autoincrement": true, "notnull": true, "unsigned": true }
			},
			{
				"name": "epp_name",
				"comment": "push provider name; expected values are 'fcm' and 'apns'",
				"type": "blob",
				"options": { "notnull": true, "length": 255 }
			}
		],
		"indexes": [],
		"pk": [ "epp_id" ]
	},
	{
		"name": "echo_push_subscription",
		"comment": "Stores push subscriptions associated with wiki users.",
		"columns": [
			{
				"name": "eps_id",
				"type": "integer",
				"options": { "autoincrement": true, "notnull": true, "unsigned": true }
			},
			{
				"name": "eps_user",
				"comment": "central user ID",
				"type": "integer",
				"options": { "notnull": true, "unsigned": true }
			},
			{
				"name": "eps_token",
				"comment": "platform-provided push subscription token",
				"type": "blob",
				"options": { "notnull": true, "length": 65530 }
			},
			{
				"name": "eps_token_sha256",
				"comment": "SHA256 digest of the push subscription token (to be used as a uniqueness constraint, since the tokens themselves may be large)",
				"type": "string",
				"options": { "notnull": true, "length": 64, "fixed": true }
			},
			{
				"name": "eps_provider",
				"comment": "push provider ID, expected to reference values 'fcm' or 'apns'",
				"type": "mwtinyint",
				"options": { "notnull": true, "unsigned": true }
			},
			{
				"name": "eps_updated",
				"comment": "last updated timestamp",
				"type": "datetimetz",
				"options": { "notnull": true, "PlatformOptions": { "version": true } }
			},
			{
				"name": "eps_data",
				"comment": "push subscription metadata (e.g APNS notification topic)",
				"type": "blob",
				"options": { "notnull": false, "length": 65530 }
			},
			{
				"name": "eps_topic",
				"comment": "APNS topic ID, references a row ID (ept_id) from echo_push_topic",
				"type": "mwtinyint",
				"options": { "notnull": false, "unsigned": true }
			}
		],
		"indexes": [
			{
				"name": "eps_token_sha256",
				"columns": [ "eps_token_sha256" ],
				"unique": true
			},
			{
				"name": "eps_provider",
				"columns": [ "eps_provider" ],
				"unique": false
			},
			{
				"name": "eps_topic",
				"columns": [ "eps_topic" ],
				"unique": false
			},
			{
				"name": "eps_user",
				"columns": [ "eps_user" ],
				"unique": false
			},
			{
				"name": "eps_token",
				"columns": [ "eps_token" ],
				"options": { "lengths": [ 10 ] },
				"unique": false
			}
		],
		"pk": [ "eps_id" ]
	},
	{
		"name": "echo_push_topic",
		"comment": "Table for normalizing APNS push message topics, for use with the NameTableStore construct.",
		"columns": [
			{
				"name": "ept_id",
				"type": "mwtinyint",
				"options": { "autoincrement": true, "notnull": true, "unsigned": true }
			},
			{
				"name": "ept_text",
				"comment": "full topic text",
				"type": "blob",
				"options": { "notnull": true, "length": 255 }
			}
		],
		"indexes": [],
		"pk": [ "ept_id" ]
	}
]
