Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sjwmoveon authored May 3, 2024
1 parent 226f4e0 commit 454e1db
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions migrations/20240503180901_campaigncontactsupdatedat.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/

const { onUpdateTrigger } = require('./helpers/index')
const ON_UPDATE_TIMESTAMP_FUNCTION = `
CREATE OR REPLACE FUNCTION on_update_timestamp()
Expand All @@ -17,6 +12,9 @@ $$ language 'plpgsql';

const DROP_ON_UPDATE_TIMESTAMP_FUNCTION = `DROP FUNCTION on_update_timestamp`

/**
* @param { import("knex").Knex } knex
*/
exports.up = async function(knex) {
const isSqlite = /sqlite/.test(knex.client.config.client);
if (!isSqlite) {
Expand All @@ -27,12 +25,11 @@ exports.up = async function(knex) {

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = async function(knex) {
const isSqlite = /sqlite/.test(knex.client.config.client);
if (!isSqlite) {
await knex.raw("DROP TRIGGER campaign_contact_updated_at on campaign_contact");
await knex.raw(DROP_ON_UPDATE_TIMESTAMP_FUNCTION);
}
};
};

0 comments on commit 454e1db

Please sign in to comment.