Re: [sqlite] After column add, what should be done to update the schema?

2020-02-29 Thread Anthony DeRobertis

On 2/27/20 7:03 PM, Andy KU7T wrote:

Hi,

I use a simple ALTER TABLE ADD COLUMN statement. However, when I use the Sqlite 
Expert, the DDL is not reflected.


One thing to be aware of is that when SQLite adds the column, it often 
doesn't format it like you'd expect. For example:


CREATE TABLE a (
    col1 integer not null primary key,
    col2 integer
);

adding a column may well wind up with something like:

CREATE TABLE a (
    col1 integer not null primary key,
    col2 integer, col3 integer
);

... note how it's been tacked on to the same line as col2. That can make 
it easy to miss when reading through a pile of SQL.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqldiff does not report foreign key constraint differences

2019-10-29 Thread Anthony DeRobertis
The "Limitations" section of the sqldiff documentation mentions it 
doesn't handle triggers or views, but nothing about constraints. So I 
expected this to report something (note how in db1, t3.ref refences t1; 
in db2, it references t2):


sqlite> .open db1
sqlite> pragma foreign_keys = 1;
sqlite> create table t1 (a integer not null primary key);
sqlite> create table t2 (b integer not null primary key);
sqlite> create table t3 (c integer not null primary key, ref integer not null 
references t1);
sqlite> .open db2
sqlite> pragma foreign_keys = 1;
sqlite> create table t1 (a integer not null primary key);
sqlite> create table t2 (b integer not null primary key);
sqlite> create table t3 (c integer not null primary key, ref integer not null 
references t2);
sqlite> .quit
$ sqldiff db1 db2
$

I expected some output there.

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users