This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Repo.Migrations.AddPostgresTriggerAndFunctionForAllTables do | |
use Ecto.Migration | |
def up do | |
# Create a function that broadcasts row changes | |
execute " | |
CREATE OR REPLACE FUNCTION broadcast_changes() | |
RETURNS trigger AS $$ | |
DECLARE | |
current_row RECORD; |