Skip to content

Commit

Permalink
* Adding warning on triggers upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
imincik committed Nov 4, 2011
1 parent 7617a3a commit 7b28315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions history_tracker.sql
Expand Up @@ -113,7 +113,6 @@ LANGUAGE plpgsql VOLATILE;


-- HT_Init
-- TODO: warn when initing already enabled table (upgrades)
CREATE OR REPLACE FUNCTION HT_Init(dbschema text, dbtable text)
RETURNS text AS
$BODY$
Expand Down Expand Up @@ -160,7 +159,8 @@ if plpy.execute("SELECT _HT_TableExists('history_tracker', '%(dbschema)s__%(dbta
plpy.execute(sql_history_tab)
plpy.execute(sql_history_tab2)
plpy.execute(sql_create_difftype)

else:
plpy.warning('History already enabled, upgrading history triggers.')

#AtTime function
sql_attime_funct = """
Expand Down
3 changes: 2 additions & 1 deletion test/test_edit.sql
Expand Up @@ -28,7 +28,7 @@



SELECT plan(46);
SELECT plan(47);

-- TEST EMPTY TABLE
SELECT is(ht_init('myschema', 'mytable'), 'History is enabled.', '*** Init history (empty table). ***');
Expand Down Expand Up @@ -311,6 +311,7 @@
' => Check timestamp values in history table.'
);

SELECT is(ht_init('myschema', 'mytable'), 'History is enabled.', '*** Upgrade history triggers. ***');

SELECT * FROM finish();
--ROLLBACK;

0 comments on commit 7b28315

Please sign in to comment.