--[[----------------------------------------------------------------------------

RxTestNotifications_v1.1.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2020 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remain the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and may be covered by U.S. and Foreign
Patents, patents in process, and are protected by trade secret or copyright
law.  Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

------------------------------------------------------------------------------]]

--============================================================================--

local function generateSchema( rxDatabase )

	rxDatabase:addTable(
		[[CREATE TABLE notifications(
			id UNIQUE,
			time,
			read,
			visited DEFAULT 0,
			needsUpdateOnANS DEFAULT 0
		)]])
		:onConflict( 'alter', {
			[[ALTER TABLE notifications ADD COLUMN visited DEFAULT 0]], 
			[[ALTER TABLE notifications ADD COLUMN needsUpdateOnANS DEFAULT 0]],
		} )	
	-- rxDatabase:addIndex( "CREATE INDEX notifications_id ON notifications( id )" )
	-- rxDatabase:addIndex( "CREATE INDEX notifications_time ON notifications( time )" )

end

--------------------------------------------------------------------------------

return {
	generateSchema = generateSchema,
}
