MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Issue with db update script 4.7.40.3321 (Zatvorena) (Mono Support )

41326 put(a) pogledan, 14 odgovor(a) 2.6.2014. 12:23:36Kreirao(la) Zoomicon

Povezane teme

Zoomicon

Zoomicon

2.6.2014. 12:23:36

upgrading from db 4.5.3103 and want to go to 4.7.40.4545

the first folder after 4.5.3016.35 (have higher version than that) is 4.7.40.3321, so I guess I need to run those SQL scripts first

in there, I see 00. Change calendar event.sql which throws error at

CREATE TABLE dbo.CalendarEventEntry

(

CalendarId uniqueidentifier NOT NULL,

CalendarEventId uniqueidentifier NOT NULL

) ON [PRIMARY]

Msg 207, Level 16, State 1, Line 40

Invalid column name 'CalendarId'.

this is logical since the table already exists and has the following fields: CalendarId, CalendarEventId, IsBusy (bit, not null)

- should I delete the old table (it's empty, although the CalendarEvent table has some entries, not sure what that extra table is for)?
</br>

- what about the "isBusy" column? the new script doesn't seem to create such column


</br>

</br>

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

2.6.2014. 12:27:01
also what about the contraint DF_CalendarEventEntry_IsBusy that is related to the IsBusy field? Should I delete that too?
Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

2.6.2014. 12:31:14

decided to comment-out that CREATE TABLE and run the script and then it throws error at:

INSERT INTO CalendarEventEntry

([CalendarId]

,[CalendarEventId])

SELECT CalendarId, Id FROM CalendarEvent

Msg 207, Level 16, State 1, Line 42

Invalid column name 'CalendarId'.

</br>

</br>

I see the CalendarEvent has columns Id and OwnerCalendarId, but not CalendarId

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

2.6.2014. 12:40:39
event when I changed CalendarId to OwnerCalendarId in that last issue, it complained later on that a primary key already existed at
</br>
</br>

ALTER TABLE dbo.CalendarEventEntry ADD CONSTRAINT

PK_CalendarEventEntry PRIMARY KEY CLUSTERED

(

CalendarId,

CalendarEventId

) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

2.6.2014. 12:42:24

luckily the script uses transactions, so no damage was done from testing it (I hope)

I ended up renaming the old dbo.CalendarEventEntry to dbo._CalendarEventEntry and editing the script to write

INSERT INTO CalendarEventEntry

([CalendarId]

,[CalendarEventId])

SELECT OwnerCalendarId, Id FROM CalendarEvent

(it was saying SELECT CalendarId, Id there)
</br>
</br>and then it run fine (fingers crossed about the implications of that edit)

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

2.6.2014. 12:54:38

oops, I also had to remove
</br>

ALTER TABLE dbo.CalendarEvent

DROP COLUMN CalendarId

for the transaction to execute (didn't notice that the "8 row(s) affected" wasn't shown - it was showing a green tick and a row of error info [because of the catch block you have there, maybe should remove it since it can confuse the user])

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
khorvat

khorvat

2.6.2014. 13:05:15
Hi,

yes you should run 3321, 3378, 3381, 3471, 3507, 3540, 3715, 3765, 3824, 3842 & 4545 in this particular order. I noticed that you got an error related to CalendarEventEntry in 3321 so we will test this against the 4.5.3016.35 and get back to you shortly.

After all did you manage to upgrade to the latest version or you are still on the 3321 ?

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
Zoomicon

Zoomicon

2.6.2014. 13:55:04

the thing is that I was using db version, not monox version when looking at those folders

this can be very confusing since they use similar numbering pattern

now I did it using the monox version of my old site instead, hope this is the correct way

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
dbogdan

dbogdan

3.6.2014. 12:32:23
Hi Zoomicon,

Have you managed to upgrade it completely, or do you still have some issues?
If you are still encountering some issues, please send us detailed report.

Regards,
Darjan Bogdan
Ovaj sadržaj još nije ocijenjen. 
231 Reputacija 38 Ukupno objava
Zoomicon

Zoomicon

3.6.2014. 16:54:42

yes, I had to go back to the backup db I had taken before starting the process then starting again

some readme.txt should exist in the SQL scripts folder to tell the user what to do and note there that those are monox versions they should compare against, not monox database versions

also, it would be nice if there was some automated process (say PowerShell to run those scripts [asking you what your monox version was and then finding folders and files needed to run automatically and running them, notifying you as it proceeds through each step)

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
1 2