Skip to content

Commit

Permalink
Set Betrag NOT NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann Maierhofer committed Dec 18, 2024
1 parent 0f385d7 commit e8602d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public String alterColumnNotNull(String table, Column col)
{
case H2:
return "ALTER TABLE " + table + " ALTER COLUMN " + col.getName()
+ " SET NULL\n";
+ " SET NOT NULL;\n";
case MYSQL:
return "ALTER TABLE " + table + " MODIFY COLUMN " + col.getName() + " "
+ getType(col) + ";\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package de.jost_net.JVerein.server.DDLTool.Updates;

import de.jost_net.JVerein.server.DDLTool.AbstractDDLUpdate;
import de.jost_net.JVerein.server.DDLTool.Column;
import de.willuhn.util.ApplicationException;
import de.willuhn.util.ProgressMonitor;

Expand All @@ -30,5 +31,9 @@ public Update0452(String driver, ProgressMonitor monitor, Connection conn)
public void run() throws ApplicationException
{
execute("update mitgliedskonto set betrag = 0 where betrag IS NULL");

Column betrag = new Column("betrag", COLTYPE.DOUBLE, 0, null, true,
false);
execute(alterColumnNotNull("mitgliedskonto", betrag));
}
}

0 comments on commit e8602d8

Please sign in to comment.