-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_db_deltas.sql
4 lines (4 loc) · 1.42 KB
/
get_db_deltas.sql
1
2
3
4
start transaction;
truncate provisioning.db_delta;
insert into provisioning.db_delta select Host , Db , uc.User , Select_priv , Insert_priv , Update_priv , Delete_priv , Create_priv , Drop_priv , Grant_priv , References_priv , Index_priv , Alter_priv , Create_tmp_table_priv , Lock_tables_priv , Create_view_priv , Show_view_priv , Create_routine_priv , Alter_routine_priv , Execute_priv , Event_priv , Trigger_priv , Server from provisioning.dbx d,provisioning.user_class uc where d.user=uc.class and not exists (select * from provisioning.db_audit da inner join provisioning.user_class uc2 on da.user = uc2.user where uc.user=da.user and d.server=da.server and d.host=da.host and d.select_priv = da.select_priv and d.insert_priv = da.insert_priv and d.update_priv = da.update_priv and d.delete_priv = da.delete_priv and d.create_priv = da.create_priv and d.drop_priv = da.drop_priv and d.grant_priv = da.grant_priv and d.references_priv = da.references_priv and d.index_priv = da.index_priv and d.alter_priv = da.alter_priv and d.create_tmp_table_priv = da.create_tmp_table_priv and d.lock_tables_priv = da.lock_tables_priv and d.execute_priv = da.execute_priv and d.create_view_priv = da.create_view_priv and d.show_view_priv = da.show_view_priv and d.create_routine_priv = da.create_routine_priv and d.alter_routine_priv = da.alter_routine_priv and d.event_priv = da.event_priv and d.trigger_priv = da.trigger_priv );
commit;