[PATCH] migrate the database schema to SQLAlchemy
Lukas Fleischer
lfleischer at archlinux.org
Sat Feb 22 21:43:31 UTC 2020
On Sun, 16 Feb 2020 at 21:56:10, Frédéric Mangano-Tarumi wrote:
> The new schema was generated with sqlacodegen and then manually adjusted
> to fit schema/aur-schema.sql faithfully, both in the organisation of the
> code and in the SQL generated by SQLAlchemy.
>
> Initializing the database now requires the new tool aurweb.initdb.
> References to aur-schema.sql have been updated and the old schema
> dropped.
> ---
> INSTALL | 12 +-
> TESTING | 23 +--
> aurweb/db.py | 27 +++
> aurweb/initdb.py | 47 +++++
> aurweb/schema.py | 387 ++++++++++++++++++++++++++++++++++++++
> schema/Makefile | 12 --
> schema/aur-schema.sql | 415 -----------------------------------------
> schema/reloadtestdb.sh | 29 ---
> test/Makefile | 6 +-
> test/setup.sh | 5 +-
> 10 files changed, 481 insertions(+), 482 deletions(-)
> create mode 100644 aurweb/initdb.py
> create mode 100644 aurweb/schema.py
> delete mode 100644 schema/Makefile
> delete mode 100644 schema/aur-schema.sql
> delete mode 100755 schema/reloadtestdb.sh
>
> diff --git a/INSTALL b/INSTALL
> index 7170aea1..68fe5dcd 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -45,16 +45,16 @@ read the instructions below.
> [...]
> +5) Create a new MySQL database and a user and import the aurweb SQL schema:
> +
> + $ python -m aurweb.initdb
> +
I noticed that this step is slightly confusing: the command must be
executed from the aurweb/ subdirectory, not the top-level directory of
the project. I will probably add an additional line
$ cd /srv/http/aurweb/aurweb/
before the command.
More information about the aur-dev
mailing list