How to setup Alembic versioning for a specific schema in a database? - sqlalchemy

I have a database with multiple schemas in which multiple schemas exist and each schema has tables related to a different part of my business.
I have a schema registration that contains relevant tables to a registration app. The tables related to the registration schema are just a small subset of all the tables in the data and are functionally and relationally unrelated to tables in other schemas. I want to start working with Alembic versioning for this schema. However, I can not find how to setup Alembic so that it's only operating on tables related to a specific schema instead of the whole database. Is there a way to do this without having to implement all tables in Alembic? Running on MSSQL.

Related

Database schema vs database structure

What is the difference between database schema and database structure?
I am learning dbms and these two words are confusing for me. Dint find much information anywhere else.
Database schema and database structure can be used interchangeably, more or less. Most software developers will understand them to mean the same thing.
Schema in particular is used in two different ways:
A schema is like a folder that contains tables. You use statements like CREATE SCHEMA <schemaname>, DROP SCHEMA <schemaname>, USE <schemaname>. In MySQL, SCHEMA and DATABASE are synonyms in most contexts.
A schema is sometimes used to refer to the full definition of all objects in your project, including the schema, tables, indexes, procedures, functions, etc.

is it enogh to have a single database for the entire software or any application like (if i am using MS Access database in my software)

I'm designing a database and I have a query about how to structure tables in Microsoft Access.
I'm not sure if I should create a new database for each table I create, or put all of my tables into one database.
Here are examples of the tables I require:
employee_info data
machine info
billing
A single database can have multiple tables amd you can use multiple applications. There is no sense in creating multiple databases for multiple tables.

Create and share table schema in confluence

I have three big databases which is mysql and each database has at least over 10 tables. I have to share those tables schema with other team and we just decided to use confluence, because we already using it to track development issues.
I wonder if there is any way to create table schema in confluence. If it is impossible then I would like to know other methods to create table schema.

Combine several mssql database to one mysql with php

We are handling a data aggregation project by having several microsoft sql server databases combining to one mysql database. all mssql database have the same schema.
The requirements are :
each mssql database can be imported to mysql independently
before being able to import each record to mysql we need to validates each records with a specific createrias via php.
each imported mssql database can be rollbacked. It means even it already imported to mysql, all the mssql database can be removed from the mysql.
we would still like to know where does each record imported to the mysql come from what mssql database.
All import process will be done with PHP .
we have difficulty in many aspects. we don't know what is the best approach to solve our problem.
your help will be highly appreciated.
ps: each mssql database has around 60 tables and each table can have a few hundred thousands .
Don't use PHP as a database administration utility. Any time you build a quick PHP script to transfer records directly from one database to another, you're going to cause yourself a world of hurt when that script becomes required for production operation.
You have a number of problems that you need solved:
You have multiple MSSQL databases with similar if not identical tables.
You have a single MySQL database that you want to merge the data into.
The imported data must be altered in a specific way before being merged.
You want to prevent all duplicate records in your import.
You want to know what database each record originally came from.
The solution?
Analyze the source MSSQL databases and create a merge strategy for them.
Create a database structure on the MySQL database that fits the merge strategy in #1, including all the new key constraints (like unique and foreign keys) required for the consolidation.
At this point you have two options left:
Dump the data from each of the source databases into raw data using your RDBMS administration utility of choice. Alter that data to fit your merge strategy and constraints. Document this, and then merge all of the data into your new database structure.
Use a tool like opendbcopy to map columns from one database to another and run a mass import.
Hope this helps.

Entity Framework expose several databases as a whole

I have three databases with exactly the same schema (SAP Business One databases). In this databases I have an item masters table connected to a warehouse stock table via the item code. Can I have just one Entity framework model that has only one item master object and one warehouse stocks object which draws data from the 3 databases?
The items are the same in the three databases but they have different warehouse codes.
I don't know if I have made myself clear.
If you want single EF model which will simultaneously load data from three databases then answer is no. If you want single EF model which can be used for all three databases the answer is yes but all your databases must use same database provider (server) and must have exactly the same schema of mapped tables.
The whole magic in this case is in connection string which can connect only to single database and cross database calls are not allowed.
If you need the first scenario you can try to hide unions and cross database queries in views and map those views in your model. This have two disadvantages:
Relation between views are not allowed in SQL Server but you can create the relation in EF model
Views are read only in EF model. If you want to modify data the best way is mapping stored procedures which will do that.