<?xml version="1.0" encoding="UTF-8"?>
<reporter xmlns:xi="http://www.w3.org/2001/XInclude">
<classes>
+
<class
- name="silly-base"
+ name="silly-all"
fact-table="silly.fact">
<description>Silly Report base</description>
<dims>
<dim include="silly_sayer_dim"/>
</dims>
</class>
+
+ <class
+ name="silly-words"
+ fact-table="silly.fact">
+ <description>Silly Word Report base</description>
+ <dims>
+ <dim include="silly_word_dim"/>
+ </dims>
+ </class>
</classes>
<tables>
<link
field="silly_word_dim"
table="silly.word_dim"
+ key="id"
type="has_a"/>
<link
field="silly_sayer_dim"
table="silly.sayer_dim"
+ key="id"
type="has_a"/>
</links>
</table>
warn "\n";
print "DROP TABLE $tname CASCADE;\n";
print "CREATE TABLE $tname (\n\t".
- join(",\n\t",
- map { join("\t", @$_) } (@primary, @other)
- ). ",\n\tCONSTRAINT $pkey_name PRIMARY KEY (".join(", ", map { $$_[0] } @primary).
- ")\n);\n";
+ join(",\n\t", map { join("\t", @$_) } (@primary, @other))."\n".
+ do {
+ @primary ?
+ ",\tCONSTRAINT $pkey_name PRIMARY KEY (".
+ join(", ", map { $$_[0] } @primary). ")\n" :
+ ''
+ }.
+ ");\n";
- for my $i (@indexed) {
- print "CREATE INDEX \"${tname}_$$i[0]_idx\" ON $tname USING $$i[1] ($$i[0]);\n";
- }
print "\n";
if ($table->getAttribute('partition')) {
}
print "\n";
}
+ } else {
+ for my $i (@indexed) {
+ print "CREATE INDEX \"${tname}_$$i[0]_idx\" ON $tname USING $$i[1] ($$i[0]);\n";
+ }
}
print "\n";