Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Проект является форком yoyo-migrations https://ollycope.com/software/yoyo/latest/

Компонент позволяет работать с миграциями баз данных posgtresql и mssql с использованием файлов sql

Установка

При установке компонента для миграций в postgres, можно использовать команду

pip install classic-migrations[postgres]

для MSSQL

pip install classic-migrations[pymssql]

Настройка

Все настройки берутся из переменных окружения или .env файла

.env file:

#папка с файлами миграций

SOURCE=./migrations

#пакетный режим исполнения, при котором нет диалоговых вопросов

BATCH_MODE=on|off(default)

#уровень вывода информационных сообщений

VERBOSITY=0|1|2|3

#настройки подключения к базе

#драйвер

DATABASE_DRIVER=pymssql|postgres|pyodbc

#имя пользователя БД

DATABASE_USER=

#домен пользователя БД (опционально)

DATABASE_USER_DOMAIN=

#пароль

DATABASE_PASSWORD=

#хост

DATABASE_HOST=

#порт

DATABASE_PORT=

#имя БД

DATABASE_NAME=

Команды запуска

migrations list

migrations new –sql -m ‘комментарий, который будет добавлен к имени файла’

migrations apply

migrations rollback

Для выполнения команды rollback, должен иметься .sql файл миграции, у которого между именем оригинального фала и расширением имеется вставка .rollback

Примечания

В SQL файле миграции можно указать комментарий, который будет добавлен в таблицу истории миграций.

– comment: текст комментария

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

classic_migrations-0.1b1.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

classic_migrations-0.1b1-py3-none-any.whl (46.8 kB view details)

Uploaded Python 3

File details

Details for the file classic_migrations-0.1b1.tar.gz.

File metadata

  • Download URL: classic_migrations-0.1b1.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for classic_migrations-0.1b1.tar.gz
Algorithm Hash digest
SHA256 94c89313796cd4e9685b96dde44de21306861bd93f754346b0c6dfa89c7bbe49
MD5 4f2c0f84f2d4cec76086eca9ed644365
BLAKE2b-256 b5a143ea96a79536db46dca56053ad0d253f5b226245ffe6b19aa38938589ede

See more details on using hashes here.

Provenance

The following attestation bundles were made for classic_migrations-0.1b1.tar.gz:

Publisher: publish.yml on variasov/classic-migrations

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file classic_migrations-0.1b1-py3-none-any.whl.

File metadata

File hashes

Hashes for classic_migrations-0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc6d7b1f43905fb44c988b5605bdb0b2dbb0583328e05c81fe6dee5951380a19
MD5 4baa88dfffd0c3e55578b299f1014a1c
BLAKE2b-256 fcde5270e4e1282dd46b2e5b656f8d09ffe6e7dbf48d31ccf6a74125590ebfe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for classic_migrations-0.1b1-py3-none-any.whl:

Publisher: publish.yml on variasov/classic-migrations

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.1

2 files

2.0.0

2 files

This release

0.1b1 This release

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

1 file

0.0.14

1 file

0.0.13

1 file

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page