| 
	
		| 
		
			|  | SoftTree Technologies Technical Support Forums
 |  |  
	
		| 
	
	
	
		| Author | Message |  
		| gemisigo 
 
 
 
 
			
				| Joined: 11 Mar 2010 Posts: 2175
 
 |  
 | 
			
				|  [SA 7.2.338 Pro] - Issues with schema compare |   |  
				| I have issues with schema compare. I'm comparing an SQLite database to another one. The code the comparison creates for views is faulty. There's an example below: 
 
 
	|  |  
	|  | CREATE VIEW [v_hely_tipusok] AS
 SELECT
 pt.id_point_type  AS _id
 ,pt.[name]         AS [name]
 ,pt.[description]  AS [description]
 ,pt.icon_path      AS icon
 FROM
 point_types   AS ptCREATE VIEW [v_hely_tipusok] AS
 SELECT
 pt.id_point_type  AS _id
 ,pt.[name]         AS [name]
 ,pt.[description]  AS [description]
 ,pt.icon_path      AS icon
 FROM
 point_types   AS pt
 
 |  
 |  |  
		| Thu Sep 24, 2015 12:47 pm |     |  
		|  |  
		| SysOp Site Admin
 
 
 
 
			
				| Joined: 26 Nov 2006 Posts: 7990
 
 |  
 | 
			
				|   |   |  
				| Thank for reporting this. It looks like a bug in the schema compare template for views for SQLite. I'm going to submit this bug for further analysis, hope the required fix is trivial. 
 |  |  
		| Thu Sep 24, 2015 5:27 pm |     |  
		|  |  
		| gemisigo 
 
 
 
 
			
				| Joined: 11 Mar 2010 Posts: 2175
 
 |  
 | 
			
				|   |   |  
				| The template looks fine but it seem that the contents of [DDL] column is added twice. 
 |  |  
		| Fri Sep 25, 2015 3:36 am |     |  
		|  |  
		| SysOp Site Admin
 
 
 
 
			
				| Joined: 26 Nov 2006 Posts: 7990
 
 |  
 | 
			
				|   |   |  
				| Additional testings revealed that the issue is not in the schema compare template but somewhere else. Ticket #SA0027161 has been opened for this issue.  I hope a fix will be provided in 7.3 release. 
 |  |  
		| Sat Sep 26, 2015 1:48 pm |     |  
		|  |  
		| SysOp Site Admin
 
 
 
 
			
				| Joined: 26 Nov 2006 Posts: 7990
 
 |  
 | 
			
				|   |   |  
				| the fix is actually very simple. In SQL Assistant Schema Compare options for SQLite please modify "Objects DDL" query as the following 
 
 
	|  |  
	|  | SELECT 'main' AS [Schema name],
 name AS [Object name],
 sql AS [DDL]
 FROM sqlite_master
 WHERE type = 'table'
 |  
 |  |  
		| Mon Sep 28, 2015 7:54 pm |     |  
		|  |  
		| gemisigo 
 
 
 
 
			
				| Joined: 11 Mar 2010 Posts: 2175
 
 |  
 | 
			
				|   |   |  
				| But wouldn't that remove comparison of views altogether? 
 |  |  
		| Tue Sep 29, 2015 3:32 am |     |  
		|  |  
		| SysOp Site Admin
 
 
 
 
			
				| Joined: 26 Nov 2006 Posts: 7990
 
 |  
 | 
			
				|   |   |  
				| No, it won't.  Another option (namely Use SQL Assistance Queries) in a different place in combination with this query makes the engine process view twice resulting in a duplicate DDL. This is SQLite specific handling. SQLite handling is quite different from other db servers, because it lacks regular database catalog tables. 
 |  |  
		| Tue Sep 29, 2015 9:19 am |     |  
		|  |  
		|  |  
  
	| 
 
 | You cannot post new topics in this forum You cannot reply to topics in this forum
 You cannot edit your posts in this forum
 You cannot delete your posts in this forum
 You cannot vote in polls in this forum
 
 |  |  |