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.1b0.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.1b0-py3-none-any.whl (46.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: classic_migrations-0.1b0.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.1b0.tar.gz
Algorithm Hash digest
SHA256 640e3b4ed834ed21619df0f317c6b4d419c9eb5654d70181ac0a1f98a5d77cc5
MD5 625e065d13727c1d6df785082d2ee71d
BLAKE2b-256 56af8d57a951a8f558b33983a1cd4b9927a4e41730ad6df3a0d8317854049836

See more details on using hashes here.

Provenance

The following attestation bundles were made for classic_migrations-0.1b0.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.1b0-py3-none-any.whl.

File metadata

File hashes

Hashes for classic_migrations-0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f39dcf2ccb8b2e888bb1f29d14fb36dca6f30e4525c37e35717e0dddd7cdb8b
MD5 11dd972959e04ed428964a5e481a6934
BLAKE2b-256 72b809cbecbe226f7fd8704b5aa493f359f392de5e4da7b26910dfe3e4ca4dd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for classic_migrations-0.1b0-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.1b0 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