Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR ALTER PROCEDURE [dbo].falcon_clearSolution
- @check nvarchar(128)
- AS
- BEGIN
- if(@check<>'yes') begin
- select 'Нужно установить check=yes для очистки данных базы. Будут удалены основные бизнес объекты, кроме сист юзеров и точки 4'
- return
- end
- declare @survPointID int = 4
- delete from as_changeLog
- delete from as_codeRevisions
- delete from as_comments
- delete from as_contacts
- delete from as_emailLettersBody
- delete from as_emailLetters
- delete from as_emails
- delete from as_emailBoxes
- delete from as_mailing_log
- delete from as_events
- delete from as_msg_red
- delete from as_msg_messages
- delete from as_msg_roomUsers
- delete from as_msg_rooms
- delete from as_nt_notifications
- delete from as_exportImportLogItems
- delete from as_exportImportLog
- delete from as_en_statusesLog
- delete from [dbo].[as_en_entityInstanceFields]
- delete from as_en_entityInstances
- delete FROM as_rs_resources
- where entityCode in ('chat', 'prod', 'point', 'articleTitleImage',
- 'articleBodyImage', 'order', 'product', 'request')
- truncate table as_trace
- truncate table as_userActions
- delete from as_userSettings
- delete from tg_log
- delete from [dbo].[tg_settings]
- delete from faq_items
- delete from fin_scores
- delete from fin_financeStatusLog
- delete from fin_finances
- delete from frm_topicTags
- delete from frm_posts
- delete from frm_topics
- delete from ord_cartItems
- delete from ord_carts
- delete from ord_orders
- delete from ord_favorites
- delete from srv_bookingSlots
- delete from srv_bookings
- delete from srv_bookedSlots
- delete from srv_bookingProducts
- delete from srv_orderItems
- delete from [dbo].[srv_orders]
- delete from srv_kpItems
- delete from srv_kps
- delete from srv_kpCats
- delete from srv_requests
- delete from srv_clients
- update srv_points set directorID = NULL, notificationManagerID = NULL
- where id not in (@survPointID)
- delete from srv_managers
- delete from srv_points where id not in (@survPointID)
- delete from srv_pointLands where pointID not in (@survPointID)
- delete from fin_accounts
- where contragentID not in (92, 192)
- and contragentID not in (select contragentID from srv_points)
- delete from ctr_contragents where id not in (92, 192) and id not in (select contragentID from srv_points)
- delete from ctr_contacts where contragentID not in (select id from ctr_contragents)
- delete from as_api_actionLog
- delete from as_userRoles
- where userID not in (select id from as_users where username in ('admin', 'editor1', 'sitemanager1'))
- delete from [as_act_actorUsers]
- where userID not in (select id from as_users where username in ('admin', 'editor1', 'sitemanager1'))
- delete from as_users where username not in ('admin', 'editor1', 'sitemanager1')
- update as_settings set value = '_______ НУЖНО ЗАПОЛНИТЬ __________'
- where code in ('mail.password', 'mail.from', 'mail.loginEmail', 'robots.txt', 'testEmail',
- 'domain', 'blogAuthor', 'blogAuthorImg', 'blogBottomText')
- update as_settings set value = ''
- where code in ('CommonScripts', 'CommonStyles', 'helpChatKey', 'publicDadataToken')
- declare @msg nvarchar(256) = 'Очистка закончена '
- Select @msg
- print @msg
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement