Home > database >  Saas more batch update database
Saas more batch update database

Time:10-11



I have a saas services, each corresponding to a user on the picture, the inside of the table, the table structure is the same, in addition to mysql library,

Requirements: now I want to add a table, to modify a table structure, or modify a table data, hopes to use a function or what way can at the same time each user repository (best can filter some libraries, such as mysql, saas, can choose system library or filter which) is updated, I don't need a a switch to perform,


Hope to have a great god to give me some directions,

CodePudding user response:

The trigger + stored procedure

CodePudding user response:

reference 1/f, cloud fly me reply:
trigger + stored procedure
can be more specific?

CodePudding user response:

reference 1/f, cloud fly me reply:
trigger + stored procedure
with the process, how to get to all of the library name? Then traverse, switch how to get to the library?

CodePudding user response:

 select distinct (table_schema) from information_schema. Tables; 

You don't need to watch out

CodePudding user response:

references fly me, 4/f, cloud reply:
 select distinct (table_schema) from information_schema. Tables; 

Exclude you don't need to watch out
this know, now I use procedure, get all I need in the process of schema, but encountered a problem, can't use the use to switch the schema in the procedure

CodePudding user response:

Do not use the use, direct use of select * from schema_name, table_name

CodePudding user response:



Does not support the use of grammar, headache, schema_name, table_name, a statement are ok, I am a newer version, there may create, modify, insert a lot of tables and data operation,
  • Related