Questions tagged [schema-migration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
2 answers
181 views

Can I change the owner of the cdc schema?

I've enabled Change Data Capture (CDC) on a database using exec sys.sp_cdc_enable_db This creates a new cdc schema which is owned by the cdc user select s.* , dp.name from sys.schemas as s ...
Zikato's user avatar
  • 3,951
0 votes
1 answer
252 views

The SELECT permission was denied on the object '__EFMigrationsHistory', database 'master', schema 'dbo'

I'm trying to create asp.net core web api. (https://youtu.be/EmV_IBYIlyo?si=GcPVN7BuautDy6-j&t=1351) At the point where he executes Add-Migration InitialCreate and Update-database my console ...
Lukas Čaplikas's user avatar
0 votes
0 answers
362 views

DBeaver database export not exporting foreign keys

I have DBeaver 23.1.0 on Windows. I want to export tables (PostgreSQL) from Database A to Database B, including foreign keys. What I found out was to mark all tables from Database A -> Right click -...
fabpico's user avatar
  • 111
1 vote
1 answer
228 views

T-SQL schema changes that can be performed in O(1)

We want to minimize the downtime for our users during the upgrade process and want to ensure that our schema changes can all be performed in O(1) and are not O(n). Is there a list of documented schema ...
D.R.'s user avatar
  • 343
1 vote
1 answer
132 views

Migrate MyISAM tables to InnoDB using replication to avoid a long down time

We have to migrate MyISAM tables to InnoDB but we are afread of a long down time. In our database we have 10 MyISAM tables where 2 of them are the biggest: ~26GB data + ~10GB indexes. My question is: ...
Ela's user avatar
  • 500
5 votes
3 answers
2k views

Migrating existing tables to use INT primary key instead of UUID mysql v8

I'd love to hear everyone's opinion on this issue. I currently use Innodb mysql v8 in RDS. Our db is moderate, with ~130 tables, most are small, with our largest table having ~30 million rows over 6 ...
Muab Nhoj's user avatar
  • 411
0 votes
0 answers
83 views

Horizontal scaling with database schema

I am designing a database schema for our customers on-premise, which will be moved to Azure PaaS later. Regarding the "scale out" strategies I lean towards to create "one database",...
Avi's user avatar
  • 265
2 votes
1 answer
756 views

Adding data to a DB as migrations

Some Background We currently have a PostgreSQL DB that is "read-only", i.e. no user is allowed to write to it and all insertions are done in a controlled manner. For a while, these were done ...
fditz's user avatar
  • 121
0 votes
2 answers
616 views

Error when migrating MySQL 8 to SQL Server 2019

I get an error while migrating a database from MySQL 8.0 to SQL Server 2019 using the SQL Server Migration Assistant. The error message: ExecuteReader requires an open and available Connection. The ...
Carlos Vaz's user avatar
0 votes
1 answer
1k views

Achieving best practice schema and permissions management on PostgreSQL

I have a PostgreSQL database (12, moving to 13 imminently) with a single (Rails) application running on it, and no other users or systems connecting. The application uses the postgres user to connect ...
David Aldridge's user avatar
0 votes
1 answer
76 views

Table design comment_seen vs comment_unseen — migrate data from one to another

I have system that allows comments posted by users and tracks which users seen which comments. The read/unread state is tracked within comments_seen table. Surely enough, it grow tremendously. My goal ...
Eduard Sukharev's user avatar
2 votes
3 answers
637 views

Is it good practice to refer to a table with different names in a database schema? [closed]

We have a database currently running with a table named a certain way (let's say thing for the sake of example), and references to that table named the same way (FK would be named thing_id for ...
Aweb's user avatar
  • 21
1 vote
1 answer
800 views

Error: Not run migration 1604169742656_add-users-table is preceding already run migration 1604024614269_table-comments

I was trying to run a migration file to create a table of users but I kept getting the following error: Error: Not run migration 1604169742656_add-users-table is preceding already run migration ...
Daniel's user avatar
  • 281
0 votes
1 answer
100 views

Deploying Oracle ADW Changes from development environment to production

I'm currently running an Oracle Autonomous Data Warehouse (Oracle's cloud-based database offering) on version 19c. I have a development database on the Always Free Tier and my production database is a ...
Ash Oldershaw's user avatar
0 votes
1 answer
4k views

MariaDB Replication - Replicate only specific tables and views

Note: A backend developer here with little to no experience in setting up database servers and replication. What needs to be done Setup DB replication of an existing database with the following ...
qwertynik's user avatar
0 votes
1 answer
236 views

Data migration: copy data with insert select and fill unique column

I have some tables in Postgres like this. create table foo ( txt text ); insert into foo (txt) values ('a'); insert into foo (txt) values ('b'); insert into foo (txt) values ('c'); create table ...
425nesp's user avatar
  • 171
0 votes
2 answers
470 views

What's the best way to migrate a database to a server of a lower SQL version?

I have Database A on SQL Server 1 that is SQL Server version 2016. I need to migrate it to Server 2 that is SQL Server version 2012. Database A is pretty small, only about 5 GB total. I don't think ...
J.D.'s user avatar
  • 35.2k
0 votes
1 answer
373 views

How to perform schema migration from array to many-to-many to lookup table?

I currently am storing values in a column of type array like follows (this is just an example): CREATE TABLE blog_posts( id INTEGER PRIMARY KEY, blog_title TEXT, tags TEXT[] ); With the ...
ben_frankly's user avatar
16 votes
2 answers
5k views

Best practices for keeping protobuf spec in sync with relational database (e.g. PostgreSQL)

1. We have a schema definition in Google's Protocol Buffers format that we use to generate code for different gRPC implementations (Python, PHP) 2. We have a database (PostreSQL) that is initialized ...
Alex's user avatar
  • 403
0 votes
1 answer
165 views

Migrate legacy application to new db/schema

I apologize if I made any mistake/missing info, fist post here! I am in the process of rewriting a website from scratch to a newer tech stack with a completely redesigned architecture. The website in ...
ruben1691's user avatar
  • 101
0 votes
1 answer
84 views

Restructuring table - start with PK or not?

I am restructuring a bunch of tables in my database (in this case using a smaller data type for some columns - in most cases cutting those by ~50%, and they tend to be large columns). I've gone ...
Oded's user avatar
  • 334
0 votes
1 answer
236 views

How to speed up Oracle to PostgreSQL data transfer

I have an Oracle schema that I am transferring to PostgreSQL with ogr2ogr. This particular table has 5 columns with number(22) each. There are some 300M rows. In under 10 minutes I can transfer this ...
Stepan's user avatar
  • 213
2 votes
0 answers
1k views

Received an unsupported type from Postgres. (14) (SQLGetData)

I have database in PostgreSQL. It is simplest possible database with schema presented here: http://www.postgresqltutorial.com/postgresql-create-table/ I want to migrate it to MySQL. I trying to ...
Daniel's user avatar
  • 209