[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mifos-developer
Subject:    [Mifos-developer] Mifos Database Upgrade error
From:       "Gary Weberg" <gweberg () hughes ! net>
Date:       2007-10-30 17:39:40
Message-ID: 010d01c81b1b$dd1f92c0$6401a8c0 () GaryWebergHP
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

 

We are getting a Mifos Database upgrade error. See attached doc file.  The
error indicated that our Application DB version is 153, yet the Database
version is 154.  I found the SQL scripts to downgrade the DB from 154 153.
When I run the SQL scripts I get the errors:

 

Line 1:  Error on rename of '.\mifos\#sql-620_2' to '.\mifos\loan_Account'
(errno: 150)

Line 2:  Duplicate column name 'PARENT'_ACCOUNT_ID'

 

The script is:

 

ALTER TABLE LOAN_ACCOUNT DROP COLUMN PARENT_ACCOUNT_ID;

ALTER TABLE LOAN_ACCOUNT ADD COLUMN  PARENT_ACCOUNT_ID INTEGER;

 

ALTER TABLE LOAN_ACCOUNT ADD FOREIGN KEY (PARENT_ACCOUNT_ID)

  REFERENCES  ACCOUNT(ACCOUNT_ID) ON DELETE NO ACTION  ON UPDATE NO ACTION;

  

 

UPDATE DATABASE_VERSION SET DATABASE_VERSION = 153 WHERE DATABASE_VERSION =
154;

 

Does anyone know what is causing the SQL errors?

 

I removed all the lines except the last and at least I can get the DB
version changed.  This allows us to access Mifos again, but without altering
the tables.

 

Also, I suppose by running the ANT target build_db that I upgraded the DB to
154, but the AP was still at 153.  Is this normal to upgrade the DB schema
prior to upgrading the DB?  This was been an issue for more than a week now.
We waited a week hoping the AP would be brought up to version 154.

 

Thanks for the help,

 

Gary

 

 

 


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:st1="urn:schemas-microsoft-com:office:smarttags" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>We are getting a Mifos Database upgrade error. See attached
doc file.&nbsp; The error indicated that our Application DB version is 153, yet
the Database version is 154.&nbsp; I found the SQL scripts to downgrade the DB
from 154 153.&nbsp; When I run the SQL scripts I get the \
errors:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>Line 1:&nbsp; Error on rename of \
&#8216;.\mifos\#sql-620_2&#8217; to &#8216;.\mifos\loan_Account&#8217; (errno: \
150)<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>Line 2:&nbsp; Duplicate column name \
&#8216;PARENT&#8217;_ACCOUNT_ID&#8217;<o:p></o:p></span></font></b></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The script is:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>ALTER TABLE LOAN_ACCOUNT DROP COLUMN
PARENT_ACCOUNT_ID;<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>ALTER TABLE LOAN_ACCOUNT ADD COLUMN&nbsp;
PARENT_ACCOUNT_ID INTEGER;<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'><o:p>&nbsp;</o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>ALTER TABLE LOAN_ACCOUNT ADD FOREIGN KEY
(PARENT_ACCOUNT_ID)<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>&nbsp; REFERENCES&nbsp; ACCOUNT(ACCOUNT_ID)
ON DELETE NO ACTION&nbsp; ON UPDATE NO ACTION;<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>&nbsp; <o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'><o:p>&nbsp;</o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>UPDATE DATABASE_VERSION SET
DATABASE_VERSION = 153 WHERE DATABASE_VERSION = 154;<o:p></o:p></span></font></b></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><u><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Does anyone know what is causing the SQL \
errors?<o:p></o:p></span></font></u></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I removed all the lines except the last and at least I can
get the DB version changed.&nbsp; This allows us to access Mifos again, but
without altering the tables.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Also, I suppose by running the ANT target build_db that I
upgraded the DB to 154, but the AP was still at 153.&nbsp; Is this normal to
upgrade the DB schema prior to upgrading the DB?&nbsp; This was been an issue
for more than a week now.&nbsp; We waited a week hoping the AP would be brought
up to version 154.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks for the help,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><st1:City w:st="on"><st1:place w:st="on"><font size=2
  face=Arial><span style='font-size:10.0pt;font-family:Arial'>Gary</span></font></st1:place></st1:City><font
 size=2 face=Arial><span \
style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>


["Database Upgrade Error.doc" (application/msword)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic