private void createTableFks() {
		writeLine("-- table foreign keys and indexes --");
		int i = 0;
		for (Column column:table.columns) {
			if (column.referenceTable != null) {
				write("ALTER TABLE " + table.name + " ADD CONSTRAINT FK_" + table.name + "_" + i + " FOREIGN KEY (" + column.name + ") REFERENCES " + column.referenceTable.name);
				if (this.table.columns.get(i).deleteCascade) {
					write(" ON DELETE CASCADE");
				}
				writeLine(";");
				writeLine("/");
				skipLine();
			}
			i++;
		}

		i = 0;
		for (Column column:table.columns) {
			if (column.referenceTable != null) {
				writeLine("CREATE INDEX FK_" + table.name + "_" + i + " ON " + this.table.name + "(" + column.name + ");");
				writeLine("/");
				skipLine();
			}
			i++;
		}
	}
private void createTableFks() {
		writeLine("-- table foreign keys and indexes --");
		int i = 0;
		for (Column column:table.columns) {
			if (column.referenceTable != null) {
				write("ALTER TABLE " + table.name + " ADD CONSTRAINT FK_" + table.name + "_" + i + " FOREIGN KEY (" + column.name + ") REFERENCES " + column.referenceTable.name);
				if (this.table.columns.get(i).deleteCascade) {
					write(" ON DELETE CASCADE");
				}
				writeLine(";");
				writeLine("/");
				skipLine();
			}
			i++;
		}

		i = 0;
		for (Column column:table.columns) {
			if (column.referenceTable != null) {
				writeLine("CREATE INDEX FK_" + table.name + "_" + i + " ON " + this.table.name + "(" + column.name + ");");
				writeLine("/");
				skipLine();
			}
			i++;
		}
	}
private void createTableFks ( ) { writeLine ( "-- table foreign keys and indexes --" ) ; int i = 0 ; for ( Column column : table . columns ) { if ( column . referenceTable != null ) { write ( "ALTER TABLE " + table . name + " ADD CONSTRAINT FK_" + table . name + "_" + i + " FOREIGN KEY (" + column . name + ") REFERENCES " + column . referenceTable . name ) ; if ( this . table . columns . get ( i ) . deleteCascade ) { write ( " ON DELETE CASCADE" ) ; } writeLine ( ";" ) ; writeLine ( "/" ) ; skipLine ( ) ; } i ++ ; } i = 0 ; for ( Column column : table . columns ) { if ( column . referenceTable != null ) { writeLine ( "CREATE INDEX FK_" + table . name + "_" + i + " ON " + this . table . name + "(" + column . name + ");" ) ; writeLine ( "/" ) ; skipLine ( ) ; } i ++ ; } }
/*
create fks and indexes
/ * create fks and indexes