diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-04-11 15:58:26 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-04-11 15:58:26 +0100 |
commit | 402b546c45ccf34f47e182540b1ff399699ce906 (patch) | |
tree | 4cead8b5f754995c8b8e9b21385d1aadf0bf3a72 | |
parent | 5296c916e46becc8cc7d68d3008572c8bf0e4163 (diff) |
Add updated function to db alter sql
-rw-r--r-- | db/schema_0001-add_sessions_and_users_and_dbic_fields.sql | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/db/schema_0001-add_sessions_and_users_and_dbic_fields.sql b/db/schema_0001-add_sessions_and_users_and_dbic_fields.sql index aadaa0993..992f3c685 100644 --- a/db/schema_0001-add_sessions_and_users_and_dbic_fields.sql +++ b/db/schema_0001-add_sessions_and_users_and_dbic_fields.sql @@ -35,5 +35,13 @@ update contacts_history AlTER TABLE contacts_history alter COLUMN contact_id SET NOT NULL; + +create or replace function contacts_updated() + returns trigger as ' + begin + insert into contacts_history (contact_id, area_id, category, email, editor, whenedited, note, confirmed, deleted) values (new.id, new.area_id, new.category, new.email, new.editor, new.whenedited, new.note, new.confirmed, new.deleted); + return new; + end; +' language 'plpgsql'; commit; |