On Tue, Dec 16, 2014 at 11:40:22PM +, Simon Slavin wrote:
> If 'ALTER TABLE ... ADD COLUMN ...' fails it fails harmlessly, with
But it doesn't fail so harmlessly:
$ sqlite3 db 'alter table toy add column foo text; select 5;' || echo fail
SQL Error: duplicate column name: foo
fail
$
Note
On 16 Dec 2014, at 10:40pm, Nico Williams wrote:
> I have a habit of putting schema definitions in a file that's always
> safe to read and execute against a DB connection. This means that I
> DROP some things IF EXISTS and CREATE all things IF NOT EXISTS.
>
> But if I
I have a habit of putting schema definitions in a file that's always
safe to read and execute against a DB connection. This means that I
DROP some things IF EXISTS and CREATE all things IF NOT EXISTS.
But if I have to ALTER TABLE... there's no IF NOT EXISTS .. equivalent
for ALTER TABLE.
Funny
3 matches
Mail list logo