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

AutoMigrate: Rename/Create/Drop tables #926

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Commits on Jul 29, 2024

  1. feat: detect renamed tables

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    10a1e3b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca2d6bf View commit details
    Browse the repository at this point in the history
  3. feat: detect renamed tables

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    47c41b1 View commit details
    Browse the repository at this point in the history
  4. feat: implement fmt.Stringer queries

    - RawQuery
    - CreateTableQuery
    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    0c23401 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1600d5e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9f84145 View commit details
    Browse the repository at this point in the history
  7. chore: re-organize packages

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    630307f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f1c856d View commit details
    Browse the repository at this point in the history
  9. chore: re-organize packages

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    f989896 View commit details
    Browse the repository at this point in the history
  10. feat: detect Create/Drop table

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    06606b0 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    c94fa1a View commit details
    Browse the repository at this point in the history
  12. feat: migrate FKs

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    a9534d7 View commit details
    Browse the repository at this point in the history
  13. feat: improve FK handling

    Additionally:
    - allow custom FK names (limited applicability rn)
    - implement GetReverse for AddFK and DropFK
    - detect renamed foreign keys
    - EqualSignature handles empty models (no columns)
    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    06ad311 View commit details
    Browse the repository at this point in the history
  14. feat: detect renamed columns

    bevzzz committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    ec35f61 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2024

  1. chore: resolve dependencies

    This is a WIP commit.
    bevzzz committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    a0d996b View commit details
    Browse the repository at this point in the history
  2. refactor: remove AlterTableQuery bloat and fix test errors

    - Do not implement AppendQuery on Operation level.
    This is a leaky abstraction as queries are dialect-specific
    and migrate package should not be concerned with how they are constructed.
    - AlterTableQuery also is an unnecessary abstraction.
    Now pgdialect will just build a simple string-query for each Operation.
    - Moved operations.go to migrate/ package and deleted alt/ package.
    - Minor clean-ups and documentation.
    
    testChangeColumnType is commented out because the implementation is missing.
    bevzzz committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    ce75416 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2024

  1. feat: change column type

    Bufixes and improvements:
    - pgdialect.Inspector canonicalizes all default expressions (lowercase)
    to make sure they are always comparable with the model definition.
    - sqlschema.SchemaInspector canonicalizes all default expressions (lowercase)
    - pgdialect and sqlschema now support type-equivalence, which prevents unnecessary
    migrations like CHAR -> CHARACTER from being created.
    
    Changing PRIMARY KEY and UNIQUE-ness are outside of this commit's scope, because
    those constraints can span multiple columns.
    bevzzz committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    4e80ee1 View commit details
    Browse the repository at this point in the history