{
	"Name": "GNSS for Tachoplus Addon for SQLSERVER 2005 - Scripts",
	"Version": 1,
	"RunSqlStatements": [{
			"MinSqlServerMajorVersion": 9,
			"DestinationDatabaseName": "db_tplus_maps",
			"QueryTimeout": 300,
			"SqlScriptFile": [
				"script_2005.sql",
				"table_countries_2005.sql",
				"table_provinces_2005.sql",
				"table_cities_2005.sql",
				"indexes_2005.sql"
			]
		},{
			"MinSqlServerMajorVersion": 9,
			"DestinationDatabaseName": "db_tplus_maps",
			"QueryTimeout": 10,
			"Sql": 
			[
				"
				IF (EXISTS (SELECT name
				FROM master.dbo.sysdatabases
				WHERE (name = 'db_tplus_maps'))) begin

					use db_tplus_maps;
					IF USER_ID('{TachoPlusUser}') IS NOT NULL
						EXEC sp_dropuser '{TachoPlusUser}'

					exec sp_adduser '{TachoPlusUser}'

					EXEC sp_addrolemember 'db_datareader', '{TachoPlusUser}'
					GRANT EXECUTE ON SCHEMA::dbo TO {TachoPlusUser};

					EXEC sp_change_users_login 'Auto_Fix', '{TachoPlusUser}'
				end"
			]
		}
	]
}
