Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions that let you do pre- and post- auto-migration hooks that run in the same transaction #50

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Commits on Aug 3, 2022

  1. Overhall Constraint/Sequence naming

    Table constraints are now keyed according to what they constrain instead
    of all of their attributes, including names.
    
    No "type of all constraints, one at a time".  separate types for PRIMARY
    KEY, UNIQUE, and FOREIGN KEY constraints; all split into the "match" and
    "extra" parts.  All such constraints are now collected into a record of
    maps, with the key being the match part of that constraint type and all
    other data in the value of the map.
    
    In most places for constraint/sequence, the name is wrapped in a Maybe,
    to instruct beam-automigrate to allow postgres to choose the name, or
    use the name from the db for existing, matching entity.
    
    Sequences are now (optionally) owned by "SERIAL" columns using the built
    in "OWNED BY" syntax in postgres.  A serial column can have an optional
    name; beam-migrate will learn the name chosen by postgres at startup
    when it already exists.
    
    string parsing of DEFAULT constraints are now handled with a self
    contained attoparsec based parser in `D.B.A.Parser`.  It's only parsing
    the fragment of sql that beam-automigrate needs to understand to do it's
    job; but is a good start for gradually improving its precision as the
    need arises (future check-constraint support, as an example)
    
    More liberal use of `"lens"` library to make some code a little easier
    to understand.
    
    Fixes dodgy catalog sql query for retrieving foreign key constraints.
    how did this ever work?
    danbornside authored and fendor committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    46d29e6 View commit details
    Browse the repository at this point in the history
  2. small cleanups while submitting PR

    danbornside authored and fendor committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    3d62243 View commit details
    Browse the repository at this point in the history
  3. Remove pgSerialTyColumnType, as it had been rendered pointless almost…

    … as soon as it was added
    cgibbard authored and fendor committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    369bcfd View commit details
    Browse the repository at this point in the history
  4. Fix build of examples/readme.

    cgibbard authored and fendor committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    1cb1624 View commit details
    Browse the repository at this point in the history
  5. Update changelog

    ali-abrar authored and fendor committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    2845b09 View commit details
    Browse the repository at this point in the history
  6. Fix missing space resulting in incorrect sql

    Before ("NULLDEFAULT"):
            CREATE TABLE cities (capital BOOL NOT NULLDEFAULT
            'false'::boolean, city VARCHAR NOT NULL, location VARCHAR NOT
            NULL);
    
    After:
            CREATE TABLE cities (capital BOOL NOT NULL DEFAULT
            'false'::boolean, city VARCHAR NOT NULL , location VARCHAR NOT
            NULL );
    ali-abrar authored and fendor committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    9ef494d View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2022

  1. Handle primary key migrations

    Previous commits introduce a bug where no migration is assumed if both
    versions of a table have a primary key at all,  This commit fixes the
    case when both versions have a PK but with different columns.
    
    This also exposed a related bug that primary key migrations must be
    handled differently to unique key migrations.  a table can have only one
    PK, which has further affects on when foreign key constraints must be
    added or removed.
    danbornside committed Aug 11, 2022
    Configuration menu
    Copy the full SHA
    20f77cd View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2022

  1. Fix the priority of SequenceRenamed

    Otherwise, SequenceSetOwner will be executed on the new name before it has been renamed
    ryantrinkle committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    c890b27 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4a1b978 View commit details
    Browse the repository at this point in the history
  3. Add a missing space

    ryantrinkle committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    99afb98 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2023

  1. Add ways to run the migration that allow additional hooks to run insi…

    …de the same transaction
    cgibbard committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    4bd47e7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0f357c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    25dc22d View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2023

  1. Add "dry run" migration runners

    Namely runMigrationWithEditUpdateAndHooksDryRun and tryRunMigrationsWithEditUpdateAndHooksDryRun
    runeksvendsen committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    06ddc24 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2023

  1. Add editUpdate argument to the "tryRunMigrationsWithEditUpdate"-fun…

    …ctions
    
    As the function name implies, the functions that start with "tryRunMigrationsWithEditUpdate" should take an "editUpdate" argument -- just like their "runMigrationWithEditUpdate"-counterparts.
    runeksvendsen committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    d903167 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2023

  1. Configuration menu
    Copy the full SHA
    92be676 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Configuration menu
    Copy the full SHA
    b88a91a View commit details
    Browse the repository at this point in the history
  2. Merge branch 'cg/pre-post-hooks' of github.com:obsidiansystems/beam-a…

    …utomigrate into cg/pre-post-hooks
    ryantrinkle committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    82cec77 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2024

  1. Configuration menu
    Copy the full SHA
    614c0dc View commit details
    Browse the repository at this point in the history