sqlalchemy / sqlalchemy/alembic

Add support for temporal table migrations (`WITH SYSTEM VERSIONING`)

Open
#956 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

op directives use case
Dominant language
Python
Stars
4.4k
Forks
375
PR merge metrics
No merged PRs in 30d

Description

Describe the use case
Upgrade/downgrade temporal tables once implemented here https://github.com/sqlalchemy/sqlalchemy/issues/4797

Databases / Backends / Drivers targeted
All, specifics for SQL Server

Additional context
Some code can be taken from here (needs to get removed from SQLA core) https://github.com/tgross35/sqlalchemy/compare/master...tgross35:review-1

def visit_add_system_versioning(self, create, **kw):
     return (
        "ALTER TABLE %s ADD SYSTEM VERSIONING"
        % self.preparer.format_table(create.element)
    )

def visit_drop_system_versioning(self, drop, **kw):
    return (
        "ALTER TABLE %s ADD SYSTEM VERSIONING"
        % self.preparer.format_table(drop.element)
    )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked SQLAlchemy issue 4797 and the referenced review-1 comparison for the existing temporal-table code. Determine the upgrade and downgrade operations needed for temporal tables, with SQL Server specifics, and verify that both migration directions are supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql, sqlalchemy
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.