<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Queries</key>
	<array>
		<string>DELETE FROM Identifier</string>
        <string>CREATE TABLE IF NOT EXISTS APDBAdOpportunity (identifier TEXT PRIMARY KEY NOT NULL, placement INTEGER NOT NULL, received REAL NOT NULL)</string>
        <string>CREATE TABLE IF NOT EXISTS APDBAdCandidate (identifier TEXT PRIMARY KEY NOT NULL, opportunity_id TEXT NOT NULL, unit_id TEXT, rank INTEGER NOT NULL DEFAULT (0), state INTEGER NOT NULL, received REAL NOT NULL, impression_type INTEGER DEFAULT NULL, impression_time REAL DEFAULT NULL, FOREIGN KEY (opportunity_id) REFERENCES APDBAdOpportunity (identifier) ON DELETE CASCADE)</string>
        <string>CREATE TABLE IF NOT EXISTS APDBAdFilterReasons (candidate_id TEXT NOT NULL, policy_id INTEGER NOT NULL, policy_reason INTEGER DEFAULT NULL, policy_detail TEXT DEFAULT NULL, filter_time REAL NOT NULL, FOREIGN KEY (candidate_id) REFERENCES APDBAdCandidate (identifier) ON DELETE CASCADE)</string>
        <string>CREATE INDEX IF NOT EXISTS idx_received ON APDBAdCandidate (received)</string>
        <string>CREATE INDEX IF NOT EXISTS idx_candidate_id on APDBAdFilterReasons (candidate_id)</string>
	</array>
</dict>
</plist>
