Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value for columns is not remembered (incl. patch) #46

Closed
clapautius opened this issue Nov 24, 2012 · 1 comment
Closed

Default value for columns is not remembered (incl. patch) #46

clapautius opened this issue Nov 24, 2012 · 1 comment
Milestone

Comments

@clapautius
Copy link

The default value for columns is not remembered after load.

Steps to reproduce (I reproduced this with both master branch (v0.3.4) and 'code-refactoring' branch):

  • create a table
  • add a column with a default value
  • save the project, restart, load the project
  • the column does not have the default value anymore

I analyzed the generated xml file and the code and it seems there's an inconsistency between code and xml. In code it is used AtributosParsers::VALOR_PADRAO which is equal to "default-value" while in the xml file the attribute is "default".

A possible fix is:

diff --git a/schemas/xml/column.sch b/schemas/xml/column.sch
index a240ec3..8fd20c4 100644
--- a/schemas/xml/column.sch
+++ b/schemas/xml/column.sch
@@ -14,7 +14,7 @@ $tb [<column name=] "@{name}"
  %end

  %if @{default-value} %then
-  [ default=] "@{default-value}"
+  [ default-value=] "@{default-value}"
  %end

  %if @{protected} %then 
diff --git a/schemas/xml/dtd/column.dtd b/schemas/xml/dtd/column.dtd
index 15c6b98..d7276a2 100644
--- a/schemas/xml/dtd/column.dtd
+++ b/schemas/xml/dtd/column.dtd
@@ -9,5 +9,5 @@
 <!ELEMENT column (type?)>
 <!ATTLIST column name CDATA #REQUIRED>
 <!ATTLIST column not-null (true | false) "false">
-<!ATTLIST column default CDATA #IMPLIED>
-<!ATTLIST column protected (false|true) "false">
\ No newline at end of file
+<!ATTLIST column default-value CDATA #IMPLIED>
+<!ATTLIST column protected (false|true) "false">
@rkhaotix
Copy link
Member

Thank you @clapautius. I've applied your patch to the code-refactoring branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants