Hi all,

 

I want to set up a history of changes in a database schema. I hoped I could
simply set up triggers for changes to the SQLite_Master table, like this:

 

create table "BF SQLite_Master History"   -- record changes to  

SQLite_Master

(

        ID integer primary key

      , Date date             -- julianday utc of the date & time of the
change

      , Event     text              -- insert, delete, or update

      , SQL text              -- SQL prior to change for delete and update,
after  

change for insert

)

;

 

create trigger "BF SQLite_Master Insert"

before insert

on SQLite_Master

begin

insert into "BF SQLite_Master History"

(

        Date

      , Event

      , SQL

)

select

        julianday('now', 'utc')

      , 'insert'

      , new.SQL

;

end

;

 

But I get an error:

 

SQL error near line 1: cannot create trigger on system table

 

Is it possible to enable this functionality?

 

Thanks,

G.Satish

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to