magic_model_generator 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/License.txt +20 -0
- data/Manifest.txt +81 -0
- data/{README → README.txt} +0 -0
- data/Rakefile +58 -59
- data/lib/activerecord/base.rb +0 -2
- data/lib/magic_model_generator.rb +0 -2
- data/lib/magic_model_generator/schema.rb +1 -5
- data/lib/magic_model_generator/validations.rb +1 -0
- data/lib/magic_model_generator/version.rb +1 -1
- data/scripts/txt2html +67 -0
- data/setup.rb +1585 -0
- data/tasks/build_db.rake +85 -0
- data/test/connections/native_db2/connection.rb +25 -0
- data/test/connections/native_firebird/connection.rb +26 -0
- data/test/connections/native_frontbase/connection.rb +27 -0
- data/test/connections/native_mysql/connection.rb +27 -0
- data/test/connections/native_openbase/connection.rb +21 -0
- data/test/connections/native_oracle/connection.rb +27 -0
- data/test/connections/native_postgresql/connection.rb +23 -0
- data/test/connections/native_sqlite/connection.rb +25 -0
- data/test/connections/native_sqlite3/connection.rb +25 -0
- data/test/connections/native_sqlite3/in_memory_connection.rb +18 -0
- data/test/connections/native_sqlserver/connection.rb +23 -0
- data/test/connections/native_sqlserver_odbc/connection.rb +25 -0
- data/test/connections/native_sybase/connection.rb +23 -0
- data/test/fixtures/db_definitions/db2.drop.sql +32 -0
- data/test/fixtures/db_definitions/db2.sql +231 -0
- data/test/fixtures/db_definitions/db22.drop.sql +2 -0
- data/test/fixtures/db_definitions/db22.sql +5 -0
- data/test/fixtures/db_definitions/firebird.drop.sql +63 -0
- data/test/fixtures/db_definitions/firebird.sql +304 -0
- data/test/fixtures/db_definitions/firebird2.drop.sql +2 -0
- data/test/fixtures/db_definitions/firebird2.sql +6 -0
- data/test/fixtures/db_definitions/frontbase.drop.sql +32 -0
- data/test/fixtures/db_definitions/frontbase.sql +268 -0
- data/test/fixtures/db_definitions/frontbase2.drop.sql +1 -0
- data/test/fixtures/db_definitions/frontbase2.sql +4 -0
- data/test/fixtures/db_definitions/mysql.drop.sql +32 -0
- data/test/fixtures/db_definitions/mysql.sql +234 -0
- data/test/fixtures/db_definitions/mysql2.drop.sql +2 -0
- data/test/fixtures/db_definitions/mysql2.sql +5 -0
- data/test/fixtures/db_definitions/openbase.drop.sql +2 -0
- data/test/fixtures/db_definitions/openbase.sql +302 -0
- data/test/fixtures/db_definitions/openbase2.drop.sql +2 -0
- data/test/fixtures/db_definitions/openbase2.sql +7 -0
- data/test/fixtures/db_definitions/oracle.drop.sql +65 -0
- data/test/fixtures/db_definitions/oracle.sql +325 -0
- data/test/fixtures/db_definitions/oracle2.drop.sql +2 -0
- data/test/fixtures/db_definitions/oracle2.sql +6 -0
- data/test/fixtures/db_definitions/postgresql.drop.sql +37 -0
- data/test/fixtures/db_definitions/postgresql.sql +247 -0
- data/test/fixtures/db_definitions/postgresql2.drop.sql +2 -0
- data/test/fixtures/db_definitions/postgresql2.sql +4 -0
- data/test/fixtures/db_definitions/schema.rb +74 -0
- data/test/fixtures/db_definitions/sqlite.drop.sql +32 -0
- data/test/fixtures/db_definitions/sqlite.sql +215 -0
- data/test/fixtures/db_definitions/sqlite2.drop.sql +2 -0
- data/test/fixtures/db_definitions/sqlite2.sql +5 -0
- data/test/fixtures/db_definitions/sqlserver.drop.sql +34 -0
- data/test/fixtures/db_definitions/sqlserver.sql +243 -0
- data/test/fixtures/db_definitions/sqlserver2.drop.sql +2 -0
- data/test/fixtures/db_definitions/sqlserver2.sql +5 -0
- data/test/fixtures/db_definitions/sybase.drop.sql +34 -0
- data/test/fixtures/db_definitions/sybase.sql +218 -0
- data/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
- data/test/fixtures/db_definitions/sybase2.sql +5 -0
- data/test/{magic_model_generator_test.rb → test_magic_model_generator.rb} +1 -1
- data/test/test_rails_app/test/test_helper.rb +36 -0
- data/website/index.html +165 -0
- data/website/index.txt +83 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.js +3 -0
- data/website/template.rhtml +53 -0
- metadata +96 -329
- data/examples/singleview/account.rb +0 -94
- data/examples/singleview/account_history.rb +0 -21
- data/examples/singleview/account_reservation.rb +0 -26
- data/examples/singleview/account_type.rb +0 -54
- data/examples/singleview/account_type_aging.rb +0 -17
- data/examples/singleview/account_type_variable.rb +0 -8
- data/examples/singleview/address.rb +0 -8
- data/examples/singleview/address_format.rb +0 -49
- data/examples/singleview/address_history.rb +0 -28
- data/examples/singleview/adjustment.rb +0 -97
- data/examples/singleview/adjustment_batch.rb +0 -42
- data/examples/singleview/adjustment_invoice.rb +0 -17
- data/examples/singleview/adjustment_type.rb +0 -54
- data/examples/singleview/adjustment_type_variable.rb +0 -8
- data/examples/singleview/archive_lock_t.rb +0 -11
- data/examples/singleview/archive_result.rb +0 -15
- data/examples/singleview/archive_type.rb +0 -31
- data/examples/singleview/archive_type_table_list.rb +0 -15
- data/examples/singleview/atai_error_name.rb +0 -7
- data/examples/singleview/atlanta_form.rb +0 -23
- data/examples/singleview/atlanta_form_field.rb +0 -12
- data/examples/singleview/atlanta_group.rb +0 -285
- data/examples/singleview/atlanta_help_entry.rb +0 -32
- data/examples/singleview/atlanta_operator.rb +0 -356
- data/examples/singleview/atlanta_profile.rb +0 -47
- data/examples/singleview/atlanta_profile_func_map.rb +0 -8
- data/examples/singleview/atlanta_profile_group_map.rb +0 -10
- data/examples/singleview/atlanta_profile_role_map.rb +0 -8
- data/examples/singleview/atlanta_profile_wf_map.rb +0 -10
- data/examples/singleview/atlanta_role.rb +0 -23
- data/examples/singleview/atlanta_table_partition.rb +0 -39
- data/examples/singleview/attribute_type.rb +0 -75
- data/examples/singleview/attribute_type_variable.rb +0 -8
- data/examples/singleview/bill_run.rb +0 -93
- data/examples/singleview/bill_run_operation.rb +0 -54
- data/examples/singleview/bill_run_type.rb +0 -39
- data/examples/singleview/bill_run_type_status.rb +0 -12
- data/examples/singleview/bill_run_type_task.rb +0 -12
- data/examples/singleview/cache.rb +0 -23
- data/examples/singleview/cache_field.rb +0 -13
- data/examples/singleview/can_act_charge.rb +0 -16
- data/examples/singleview/charge.rb +0 -67
- data/examples/singleview/charge_category.rb +0 -45
- data/examples/singleview/charge_output_defn.rb +0 -13
- data/examples/singleview/charge_output_defn_history.rb +0 -22
- data/examples/singleview/charge_output_defn_var.rb +0 -10
- data/examples/singleview/configuration_attr_type.rb +0 -22
- data/examples/singleview/configuration_attribute.rb +0 -11
- data/examples/singleview/configuration_item.rb +0 -26
- data/examples/singleview/configuration_item_type.rb +0 -29
- data/examples/singleview/contract.rb +0 -35
- data/examples/singleview/contract_history.rb +0 -48
- data/examples/singleview/contract_type.rb +0 -58
- data/examples/singleview/contract_type_product.rb +0 -11
- data/examples/singleview/conversion_rate.rb +0 -14
- data/examples/singleview/currency.rb +0 -118
- data/examples/singleview/currency_history.rb +0 -28
- data/examples/singleview/customer_contact.rb +0 -12
- data/examples/singleview/customer_node.rb +0 -166
- data/examples/singleview/customer_node_bill_run.rb +0 -12
- data/examples/singleview/customer_node_charge_cat.rb +0 -22
- data/examples/singleview/customer_node_correspond.rb +0 -12
- data/examples/singleview/customer_node_da.rb +0 -11
- data/examples/singleview/customer_node_da_array.rb +0 -35
- data/examples/singleview/customer_node_history.rb +0 -86
- data/examples/singleview/customer_node_inv_format.rb +0 -33
- data/examples/singleview/customer_node_type.rb +0 -89
- data/examples/singleview/customer_node_type_cc.rb +0 -18
- data/examples/singleview/customer_node_type_da.rb +0 -8
- data/examples/singleview/customer_node_type_var.rb +0 -8
- data/examples/singleview/customer_query.rb +0 -80
- data/examples/singleview/customer_query_progress.rb +0 -20
- data/examples/singleview/customer_query_type.rb +0 -49
- data/examples/singleview/customer_query_type_var.rb +0 -8
- data/examples/singleview/delete_cascade.rb +0 -13
- data/examples/singleview/delete_cascade_group.rb +0 -21
- data/examples/singleview/delete_constraint.rb +0 -9
- data/examples/singleview/derived_attribute.rb +0 -32
- data/examples/singleview/derived_attribute_array.rb +0 -32
- data/examples/singleview/derived_attribute_history.rb +0 -41
- data/examples/singleview/derived_attribute_index.rb +0 -13
- data/examples/singleview/derived_attribute_value.rb +0 -19
- data/examples/singleview/dil.rb +0 -18
- data/examples/singleview/dil_history.rb +0 -24
- data/examples/singleview/dil_reference.rb +0 -9
- data/examples/singleview/dil_validation_t.rb +0 -6
- data/examples/singleview/dil_variable.rb +0 -10
- data/examples/singleview/dunning_t.rb +0 -14
- data/examples/singleview/entity_mapping.rb +0 -11
- data/examples/singleview/entity_remap.rb +0 -22
- data/examples/singleview/entity_validation.rb +0 -70
- data/examples/singleview/entity_validation_list.rb +0 -15
- data/examples/singleview/entity_validation_variable.rb +0 -8
- data/examples/singleview/equipment.rb +0 -28
- data/examples/singleview/equipment_history.rb +0 -62
- data/examples/singleview/equipment_type.rb +0 -57
- data/examples/singleview/equipment_type_variable.rb +0 -8
- data/examples/singleview/error_group.rb +0 -18
- data/examples/singleview/error_message.rb +0 -65
- data/examples/singleview/evs_address_equiv.rb +0 -17
- data/examples/singleview/evs_alias.rb +0 -12
- data/examples/singleview/evs_attribute_type_key.rb +0 -7
- data/examples/singleview/evt_equipment_changeover.rb +0 -9
- data/examples/singleview/expression_list.rb +0 -27
- data/examples/singleview/expression_list_value.rb +0 -17
- data/examples/singleview/fac_group_compatibility.rb +0 -11
- data/examples/singleview/fac_group_instance.rb +0 -19
- data/examples/singleview/fac_group_instance_hist.rb +0 -16
- data/examples/singleview/facility.rb +0 -9
- data/examples/singleview/facility_group.rb +0 -21
- data/examples/singleview/facility_group_history.rb +0 -21
- data/examples/singleview/foreign_key.rb +0 -9
- data/examples/singleview/function_defn.rb +0 -16
- data/examples/singleview/function_defn_history.rb +0 -35
- data/examples/singleview/function_role.rb +0 -24
- data/examples/singleview/function_role_map.rb +0 -10
- data/examples/singleview/gl_code.rb +0 -65
- data/examples/singleview/gl_code_history.rb +0 -20
- data/examples/singleview/gl_upload.rb +0 -10
- data/examples/singleview/icon.rb +0 -64
- data/examples/singleview/inv_loop_t.rb +0 -4
- data/examples/singleview/inv_report_accounts_t.rb +0 -25
- data/examples/singleview/invoice.rb +0 -134
- data/examples/singleview/invoice_contents.rb +0 -14
- data/examples/singleview/invoice_format.rb +0 -31
- data/examples/singleview/invoice_format_history.rb +0 -29
- data/examples/singleview/invoice_message.rb +0 -17
- data/examples/singleview/invoice_message_history.rb +0 -31
- data/examples/singleview/invoice_message_variable.rb +0 -10
- data/examples/singleview/invoice_receivable_type.rb +0 -13
- data/examples/singleview/invoice_type.rb +0 -23
- data/examples/singleview/invoice_type_history.rb +0 -26
- data/examples/singleview/invoice_type_variable.rb +0 -10
- data/examples/singleview/isp_email_address.rb +0 -17
- data/examples/singleview/licence_current_values.rb +0 -12
- data/examples/singleview/menu_role_map.rb +0 -10
- data/examples/singleview/normalised_event.rb +0 -119
- data/examples/singleview/normalised_event_error.rb +0 -91
- data/examples/singleview/normalised_event_file.rb +0 -75
- data/examples/singleview/normalised_event_ft.rb +0 -18
- data/examples/singleview/normalised_event_ft_hist.rb +0 -25
- data/examples/singleview/normalised_event_ft_var.rb +0 -10
- data/examples/singleview/normalised_event_type.rb +0 -54
- data/examples/singleview/output_device.rb +0 -37
- data/examples/singleview/output_method.rb +0 -32
- data/examples/singleview/output_method_type.rb +0 -38
- data/examples/singleview/output_select.rb +0 -17
- data/examples/singleview/payment.rb +0 -102
- data/examples/singleview/payment_batch.rb +0 -43
- data/examples/singleview/payment_invoice.rb +0 -17
- data/examples/singleview/payment_item.rb +0 -15
- data/examples/singleview/payment_type.rb +0 -57
- data/examples/singleview/payment_type_variable.rb +0 -8
- data/examples/singleview/person.rb +0 -60
- data/examples/singleview/person_history.rb +0 -69
- data/examples/singleview/person_type.rb +0 -39
- data/examples/singleview/plan_table.rb +0 -27
- data/examples/singleview/product.rb +0 -45
- data/examples/singleview/product_compatibility.rb +0 -13
- data/examples/singleview/product_derived_attribute.rb +0 -10
- data/examples/singleview/product_facility_group.rb +0 -16
- data/examples/singleview/product_group.rb +0 -12
- data/examples/singleview/product_group_history.rb +0 -20
- data/examples/singleview/product_history.rb +0 -35
- data/examples/singleview/product_in_product_group.rb +0 -12
- data/examples/singleview/product_instance.rb +0 -41
- data/examples/singleview/product_instance_equip.rb +0 -21
- data/examples/singleview/product_instance_history.rb +0 -37
- data/examples/singleview/product_instance_service.rb +0 -17
- data/examples/singleview/product_payment_item.rb +0 -19
- data/examples/singleview/product_service_type.rb +0 -32
- data/examples/singleview/product_service_type_equip.rb +0 -20
- data/examples/singleview/product_subtotal.rb +0 -14
- data/examples/singleview/product_tariff.rb +0 -16
- data/examples/singleview/racr_clec_t1.rb +0 -12
- data/examples/singleview/racr_clec_t2.rb +0 -12
- data/examples/singleview/racr_clec_t3.rb +0 -28
- data/examples/singleview/racr_t.rb +0 -29
- data/examples/singleview/ragd_clec_t.rb +0 -47
- data/examples/singleview/ragd_t.rb +0 -28
- data/examples/singleview/rapc_t.rb +0 -27
- data/examples/singleview/rdfd_cmn_t.rb +0 -17
- data/examples/singleview/rdfd_t.rb +0 -16
- data/examples/singleview/receivable_type.rb +0 -49
- data/examples/singleview/receivable_type_history.rb +0 -25
- data/examples/singleview/reference_code.rb +0 -17
- data/examples/singleview/reference_type.rb +0 -32
- data/examples/singleview/release_info.rb +0 -10
- data/examples/singleview/report_reference_type.rb +0 -14
- data/examples/singleview/report_reference_type_defs.rb +0 -12
- data/examples/singleview/reprocessed_file.rb +0 -32
- data/examples/singleview/rgp_file.rb +0 -22
- data/examples/singleview/rgp_normalised_event.rb +0 -78
- data/examples/singleview/rmag_t.rb +0 -32
- data/examples/singleview/rpmr_t.rb +0 -27
- data/examples/singleview/rpsi_t.rb +0 -24
- data/examples/singleview/rser_t.rb +0 -13
- data/examples/singleview/rshu_cmn_t.rb +0 -31
- data/examples/singleview/schedule.rb +0 -91
- data/examples/singleview/schedule_task_type.rb +0 -43
- data/examples/singleview/service.rb +0 -88
- data/examples/singleview/service_bill_run_t.rb +0 -12
- data/examples/singleview/service_charge_category.rb +0 -22
- data/examples/singleview/service_da.rb +0 -11
- data/examples/singleview/service_da_array.rb +0 -35
- data/examples/singleview/service_duplicate.rb +0 -4
- data/examples/singleview/service_history.rb +0 -59
- data/examples/singleview/service_type.rb +0 -54
- data/examples/singleview/service_type_cc.rb +0 -18
- data/examples/singleview/service_type_da.rb +0 -8
- data/examples/singleview/service_type_equip_type.rb +0 -11
- data/examples/singleview/subtotal.rb +0 -48
- data/examples/singleview/subtotal_history.rb +0 -59
- data/examples/singleview/subtotal_rating_delta.rb +0 -20
- data/examples/singleview/subtotal_rating_value.rb +0 -21
- data/examples/singleview/subtotal_term.rb +0 -16
- data/examples/singleview/subtotal_value.rb +0 -18
- data/examples/singleview/summary_of_change.rb +0 -31
- data/examples/singleview/summary_of_change_ev.rb +0 -18
- data/examples/singleview/summary_of_change_view.rb +0 -22
- data/examples/singleview/t2_anumber_france.rb +0 -22
- data/examples/singleview/t2_anumber_italy.rb +0 -22
- data/examples/singleview/t2_anumber_netherlands.rb +0 -24
- data/examples/singleview/t2_anumber_portugal.rb +0 -22
- data/examples/singleview/t2_anumber_spain.rb +0 -22
- data/examples/singleview/t2_anumber_switzerland.rb +0 -24
- data/examples/singleview/t2_bankreference_austria.rb +0 -7
- data/examples/singleview/t2_bankreference_belgium.rb +0 -6
- data/examples/singleview/t2_bankreference_france.rb +0 -7
- data/examples/singleview/t2_bankreference_germany.rb +0 -7
- data/examples/singleview/t2_bankreference_italy.rb +0 -7
- data/examples/singleview/t2_bankreference_portugal.rb +0 -7
- data/examples/singleview/t2_cc_provrequests.rb +0 -19
- data/examples/singleview/t2_emf_info.rb +0 -12
- data/examples/singleview/t2_ev_column_label_mapping.rb +0 -9
- data/examples/singleview/t2_historytable.rb +0 -26
- data/examples/singleview/t2_inv_revoked_invoice.rb +0 -11
- data/examples/singleview/t2_inv_suppress_invoice.rb +0 -13
- data/examples/singleview/t2_national_number_plan.rb +0 -8
- data/examples/singleview/t2_pay_statement.rb +0 -28
- data/examples/singleview/t2_prov_req_action.rb +0 -22
- data/examples/singleview/t2_prov_request.rb +0 -32
- data/examples/singleview/t2_rep_brr_t.rb +0 -19
- data/examples/singleview/t2_rep_trr_t.rb +0 -19
- data/examples/singleview/t2_rep_ubr_t.rb +0 -19
- data/examples/singleview/t2_taxclass.rb +0 -8
- data/examples/singleview/t2_zipcode_austria.rb +0 -8
- data/examples/singleview/t2_zipcode_france.rb +0 -8
- data/examples/singleview/t2_zipcode_germany.rb +0 -8
- data/examples/singleview/t2_zipcode_hungary.rb +0 -8
- data/examples/singleview/t2_zipcode_luxembourg.rb +0 -8
- data/examples/singleview/t2_zipcode_netherlands.rb +0 -8
- data/examples/singleview/t2_zipcode_portugal.rb +0 -9
- data/examples/singleview/t2_zipcode_spain.rb +0 -8
- data/examples/singleview/t2_zipcode_switzerland.rb +0 -8
- data/examples/singleview/table_import_order.rb +0 -6
- data/examples/singleview/tariff.rb +0 -51
- data/examples/singleview/tariff_charge.rb +0 -33
- data/examples/singleview/tariff_charge_defn.rb +0 -18
- data/examples/singleview/tariff_condition_defn.rb +0 -19
- data/examples/singleview/tariff_history.rb +0 -70
- data/examples/singleview/tariff_recurring.rb +0 -36
- data/examples/singleview/task_queue.rb +0 -130
- data/examples/singleview/task_queue_result.rb +0 -10
- data/examples/singleview/template.rb +0 -18
- data/examples/singleview/template_history.rb +0 -30
- data/examples/singleview/template_reference.rb +0 -9
- data/examples/singleview/template_variable.rb +0 -10
- data/examples/singleview/trt_clec_treatment.rb +0 -13
- data/examples/singleview/variable_defn.rb +0 -48
- data/examples/singleview/variable_defn_dependency.rb +0 -11
- data/examples/singleview/variable_defn_direct.rb +0 -15
- data/examples/singleview/variable_defn_history.rb +0 -22
- data/examples/singleview/work_force.rb +0 -25
- data/examples/singleview/xpsi_addr_val_commtax21.rb +0 -24
- data/examples/singleview/xpsi_addr_val_msag.rb +0 -24
- data/examples/singleview/xpsi_addr_val_zip.rb +0 -14
- data/examples/singleview/xpsi_ne_batch.rb +0 -20
- data/examples/singleview/xpsi_product_batch.rb +0 -18
- data/examples/singleview/xpsi_product_status.rb +0 -14
- data/examples/singleview/xpsi_tax_error.rb +0 -34
- data/examples/singleview/xpsi_trt_revoke.rb +0 -68
- data/examples/singleview/xpsi_trt_revoke_prod_inst.rb +0 -12
- data/examples/singleview/xpsi_update_capture.rb +0 -35
@@ -0,0 +1,37 @@
|
|
1
|
+
DROP TABLE accounts;
|
2
|
+
DROP SEQUENCE accounts_id_seq;
|
3
|
+
DROP TABLE funny_jokes;
|
4
|
+
DROP TABLE companies;
|
5
|
+
DROP SEQUENCE companies_nonstd_seq;
|
6
|
+
DROP TABLE topics;
|
7
|
+
DROP TABLE developers;
|
8
|
+
DROP TABLE projects;
|
9
|
+
DROP TABLE developers_projects;
|
10
|
+
DROP TABLE customers;
|
11
|
+
DROP TABLE orders;
|
12
|
+
DROP TABLE movies;
|
13
|
+
DROP TABLE subscribers;
|
14
|
+
DROP TABLE booleantests;
|
15
|
+
DROP TABLE auto_id_tests;
|
16
|
+
DROP TABLE entrants;
|
17
|
+
DROP TABLE colnametests;
|
18
|
+
DROP TABLE mixins;
|
19
|
+
DROP TABLE people;
|
20
|
+
DROP TABLE readers;
|
21
|
+
DROP TABLE binaries;
|
22
|
+
DROP TABLE computers;
|
23
|
+
DROP TABLE posts;
|
24
|
+
DROP TABLE comments;
|
25
|
+
DROP TABLE authors;
|
26
|
+
DROP TABLE tasks;
|
27
|
+
DROP TABLE categories;
|
28
|
+
DROP TABLE categories_posts;
|
29
|
+
DROP TABLE defaults;
|
30
|
+
DROP TABLE fk_test_has_fk;
|
31
|
+
DROP TABLE fk_test_has_pk;
|
32
|
+
DROP TABLE geometrics;
|
33
|
+
DROP TABLE keyboards;
|
34
|
+
DROP TABLE legacy_things;
|
35
|
+
DROP TABLE numeric_data;
|
36
|
+
DROP TABLE column_data;
|
37
|
+
DROP TABLE mixed_case_monkeys;
|
@@ -0,0 +1,247 @@
|
|
1
|
+
CREATE SEQUENCE public.accounts_id_seq START 100;
|
2
|
+
|
3
|
+
CREATE TABLE accounts (
|
4
|
+
id integer primary key DEFAULT nextval('public.accounts_id_seq'),
|
5
|
+
firm_id integer,
|
6
|
+
credit_limit integer
|
7
|
+
);
|
8
|
+
|
9
|
+
CREATE TABLE funny_jokes (
|
10
|
+
id serial,
|
11
|
+
name character varying(50)
|
12
|
+
);
|
13
|
+
|
14
|
+
CREATE SEQUENCE companies_nonstd_seq START 101;
|
15
|
+
|
16
|
+
CREATE TABLE companies (
|
17
|
+
id integer primary key DEFAULT nextval('companies_nonstd_seq'),
|
18
|
+
"type" character varying(50),
|
19
|
+
"ruby_type" character varying(50),
|
20
|
+
firm_id integer,
|
21
|
+
name character varying(50),
|
22
|
+
client_of integer,
|
23
|
+
rating integer default 1
|
24
|
+
);
|
25
|
+
|
26
|
+
CREATE TABLE developers_projects (
|
27
|
+
developer_id integer NOT NULL,
|
28
|
+
project_id integer NOT NULL,
|
29
|
+
joined_on date,
|
30
|
+
access_level integer default 1
|
31
|
+
);
|
32
|
+
|
33
|
+
CREATE TABLE developers (
|
34
|
+
id serial primary key,
|
35
|
+
name character varying(100),
|
36
|
+
salary integer DEFAULT 70000,
|
37
|
+
created_at timestamp,
|
38
|
+
updated_at timestamp
|
39
|
+
);
|
40
|
+
SELECT setval('developers_id_seq', 100);
|
41
|
+
|
42
|
+
CREATE TABLE projects (
|
43
|
+
id serial primary key,
|
44
|
+
name character varying(100),
|
45
|
+
type varchar(255)
|
46
|
+
);
|
47
|
+
SELECT setval('projects_id_seq', 100);
|
48
|
+
|
49
|
+
CREATE TABLE topics (
|
50
|
+
id serial primary key,
|
51
|
+
title character varying(255),
|
52
|
+
author_name character varying(255),
|
53
|
+
author_email_address character varying(255),
|
54
|
+
written_on timestamp without time zone,
|
55
|
+
bonus_time time,
|
56
|
+
last_read date,
|
57
|
+
content text,
|
58
|
+
approved boolean default true,
|
59
|
+
replies_count integer default 0,
|
60
|
+
parent_id integer,
|
61
|
+
"type" character varying(50)
|
62
|
+
);
|
63
|
+
SELECT setval('topics_id_seq', 100);
|
64
|
+
|
65
|
+
CREATE TABLE customers (
|
66
|
+
id serial primary key,
|
67
|
+
name character varying,
|
68
|
+
balance integer default 0,
|
69
|
+
address_street character varying,
|
70
|
+
address_city character varying,
|
71
|
+
address_country character varying,
|
72
|
+
gps_location character varying
|
73
|
+
);
|
74
|
+
SELECT setval('customers_id_seq', 100);
|
75
|
+
|
76
|
+
CREATE TABLE orders (
|
77
|
+
id serial primary key,
|
78
|
+
name character varying,
|
79
|
+
billing_customer_id integer,
|
80
|
+
shipping_customer_id integer
|
81
|
+
);
|
82
|
+
SELECT setval('orders_id_seq', 100);
|
83
|
+
|
84
|
+
CREATE TABLE movies (
|
85
|
+
movieid serial primary key,
|
86
|
+
name text
|
87
|
+
);
|
88
|
+
|
89
|
+
CREATE TABLE subscribers (
|
90
|
+
nick text primary key NOT NULL,
|
91
|
+
name text
|
92
|
+
);
|
93
|
+
|
94
|
+
CREATE TABLE booleantests (
|
95
|
+
id serial primary key,
|
96
|
+
value boolean
|
97
|
+
);
|
98
|
+
|
99
|
+
CREATE TABLE defaults (
|
100
|
+
id serial primary key,
|
101
|
+
modified_date date default CURRENT_DATE,
|
102
|
+
modified_date_function date default now(),
|
103
|
+
fixed_date date default '2004-01-01',
|
104
|
+
modified_time timestamp default CURRENT_TIMESTAMP,
|
105
|
+
modified_time_function timestamp default now(),
|
106
|
+
fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
|
107
|
+
char1 char(1) default 'Y',
|
108
|
+
char2 character varying(50) default 'a varchar field',
|
109
|
+
char3 text default 'a text field',
|
110
|
+
positive_integer integer default 1,
|
111
|
+
negative_integer integer default -1,
|
112
|
+
decimal_number decimal(3,2) default 2.78
|
113
|
+
);
|
114
|
+
|
115
|
+
CREATE TABLE auto_id_tests (
|
116
|
+
auto_id serial primary key,
|
117
|
+
value integer
|
118
|
+
);
|
119
|
+
|
120
|
+
CREATE TABLE entrants (
|
121
|
+
id serial primary key,
|
122
|
+
name text not null,
|
123
|
+
course_id integer not null
|
124
|
+
);
|
125
|
+
|
126
|
+
CREATE TABLE colnametests (
|
127
|
+
id serial primary key,
|
128
|
+
"references" integer NOT NULL
|
129
|
+
);
|
130
|
+
|
131
|
+
CREATE TABLE mixins (
|
132
|
+
id serial primary key,
|
133
|
+
parent_id integer,
|
134
|
+
type character varying,
|
135
|
+
pos integer,
|
136
|
+
lft integer,
|
137
|
+
rgt integer,
|
138
|
+
root_id integer,
|
139
|
+
created_at timestamp,
|
140
|
+
updated_at timestamp
|
141
|
+
);
|
142
|
+
|
143
|
+
CREATE TABLE people (
|
144
|
+
id serial primary key,
|
145
|
+
first_name text,
|
146
|
+
lock_version integer default 0
|
147
|
+
);
|
148
|
+
|
149
|
+
CREATE TABLE readers (
|
150
|
+
id serial primary key,
|
151
|
+
post_id integer NOT NULL,
|
152
|
+
person_id integer NOT NULL
|
153
|
+
);
|
154
|
+
|
155
|
+
CREATE TABLE binaries (
|
156
|
+
id serial primary key,
|
157
|
+
data bytea
|
158
|
+
);
|
159
|
+
|
160
|
+
CREATE TABLE computers (
|
161
|
+
id serial primary key,
|
162
|
+
developer integer NOT NULL,
|
163
|
+
"extendedWarranty" integer NOT NULL
|
164
|
+
);
|
165
|
+
|
166
|
+
CREATE TABLE posts (
|
167
|
+
id serial primary key,
|
168
|
+
author_id integer,
|
169
|
+
title varchar(255),
|
170
|
+
type varchar(255),
|
171
|
+
body text
|
172
|
+
);
|
173
|
+
|
174
|
+
CREATE TABLE comments (
|
175
|
+
id serial primary key,
|
176
|
+
post_id integer,
|
177
|
+
type varchar(255),
|
178
|
+
body text
|
179
|
+
);
|
180
|
+
|
181
|
+
CREATE TABLE authors (
|
182
|
+
id serial primary key,
|
183
|
+
name varchar(255) default NULL
|
184
|
+
);
|
185
|
+
|
186
|
+
CREATE TABLE tasks (
|
187
|
+
id serial primary key,
|
188
|
+
starting timestamp,
|
189
|
+
ending timestamp
|
190
|
+
);
|
191
|
+
|
192
|
+
CREATE TABLE categories (
|
193
|
+
id serial primary key,
|
194
|
+
name varchar(255),
|
195
|
+
type varchar(255)
|
196
|
+
);
|
197
|
+
|
198
|
+
CREATE TABLE categories_posts (
|
199
|
+
category_id integer NOT NULL,
|
200
|
+
post_id integer NOT NULL
|
201
|
+
);
|
202
|
+
|
203
|
+
CREATE TABLE fk_test_has_pk (
|
204
|
+
id INTEGER NOT NULL PRIMARY KEY
|
205
|
+
);
|
206
|
+
|
207
|
+
CREATE TABLE fk_test_has_fk (
|
208
|
+
id INTEGER NOT NULL PRIMARY KEY,
|
209
|
+
fk_id INTEGER NOT NULL REFERENCES fk_test_has_fk(id)
|
210
|
+
);
|
211
|
+
|
212
|
+
CREATE TABLE geometrics (
|
213
|
+
id serial primary key,
|
214
|
+
a_point point,
|
215
|
+
-- a_line line, (the line type is currently not implemented in postgresql)
|
216
|
+
a_line_segment lseg,
|
217
|
+
a_box box,
|
218
|
+
a_path path,
|
219
|
+
a_polygon polygon,
|
220
|
+
a_circle circle
|
221
|
+
);
|
222
|
+
|
223
|
+
CREATE TABLE keyboards (
|
224
|
+
key_number serial primary key,
|
225
|
+
"name" character varying(50)
|
226
|
+
);
|
227
|
+
|
228
|
+
--Altered lock_version column name.
|
229
|
+
CREATE TABLE legacy_things (
|
230
|
+
id serial primary key,
|
231
|
+
tps_report_number integer,
|
232
|
+
version integer default 0
|
233
|
+
);
|
234
|
+
|
235
|
+
CREATE TABLE numeric_data (
|
236
|
+
id serial primary key,
|
237
|
+
bank_balance decimal(10,2),
|
238
|
+
big_bank_balance decimal(15,2),
|
239
|
+
world_population decimal(10),
|
240
|
+
my_house_population decimal(2),
|
241
|
+
decimal_number_with_default decimal(3,2) default 2.78
|
242
|
+
);
|
243
|
+
|
244
|
+
CREATE TABLE mixed_case_monkeys (
|
245
|
+
"monkeyID" INTEGER PRIMARY KEY,
|
246
|
+
"fleaCount" INTEGER
|
247
|
+
);
|
@@ -0,0 +1,74 @@
|
|
1
|
+
ActiveRecord::Schema.define do
|
2
|
+
|
3
|
+
# For Firebird, set the sequence values 10000 when create_table is called;
|
4
|
+
# this prevents primary key collisions between "normally" created records
|
5
|
+
# and fixture-based (YAML) records.
|
6
|
+
if adapter_name == "Firebird"
|
7
|
+
def create_table(*args, &block)
|
8
|
+
ActiveRecord::Base.connection.create_table(*args, &block)
|
9
|
+
ActiveRecord::Base.connection.execute "SET GENERATOR #{args.first}_seq TO 10000"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
create_table :taggings, :force => true do |t|
|
14
|
+
t.column :tag_id, :integer
|
15
|
+
t.column :super_tag_id, :integer
|
16
|
+
t.column :taggable_type, :string
|
17
|
+
t.column :taggable_id, :integer
|
18
|
+
end
|
19
|
+
|
20
|
+
create_table :tags, :force => true do |t|
|
21
|
+
t.column :name, :string
|
22
|
+
t.column :taggings_count, :integer, :default => 0
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table :categorizations, :force => true do |t|
|
26
|
+
t.column :category_id, :integer
|
27
|
+
t.column :post_id, :integer
|
28
|
+
t.column :author_id, :integer
|
29
|
+
end
|
30
|
+
|
31
|
+
add_column :posts, :taggings_count, :integer, :default => 0
|
32
|
+
add_column :authors, :author_address_id, :integer
|
33
|
+
|
34
|
+
create_table :author_addresses, :force => true do |t|
|
35
|
+
t.column :author_address_id, :integer
|
36
|
+
end
|
37
|
+
|
38
|
+
create_table :author_favorites, :force => true do |t|
|
39
|
+
t.column :author_id, :integer
|
40
|
+
t.column :favorite_author_id, :integer
|
41
|
+
end
|
42
|
+
|
43
|
+
create_table :vertices, :force => true do |t|
|
44
|
+
t.column :label, :string
|
45
|
+
end
|
46
|
+
|
47
|
+
create_table :edges, :force => true do |t|
|
48
|
+
t.column :source_id, :integer, :null => false
|
49
|
+
t.column :sink_id, :integer, :null => false
|
50
|
+
end
|
51
|
+
add_index :edges, [:source_id, :sink_id], :unique => true, :name => 'unique_edge_index'
|
52
|
+
|
53
|
+
create_table :lock_without_defaults, :force => true do |t|
|
54
|
+
t.column :lock_version, :integer
|
55
|
+
end
|
56
|
+
|
57
|
+
create_table :lock_without_defaults_cust, :force => true do |t|
|
58
|
+
t.column :custom_lock_version, :integer
|
59
|
+
end
|
60
|
+
|
61
|
+
# For sqlite 3.1.0+, make a table with a autoincrement column
|
62
|
+
if adapter_name == 'SQLite' and supports_autoincrement?
|
63
|
+
create_table :table_with_autoincrement, :force => true do |t|
|
64
|
+
t.column :name, :string
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# For sqlserver 2000+, ensure real columns can be used
|
69
|
+
if adapter_name.starts_with?("SQLServer")
|
70
|
+
create_table :table_with_real_columns, :force => true do |t|
|
71
|
+
t.column :real_number, :real
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
DROP TABLE accounts;
|
2
|
+
DROP TABLE funny_jokes;
|
3
|
+
DROP TABLE companies;
|
4
|
+
DROP TABLE topics;
|
5
|
+
DROP TABLE developers;
|
6
|
+
DROP TABLE projects;
|
7
|
+
DROP TABLE developers_projects;
|
8
|
+
DROP TABLE customers;
|
9
|
+
DROP TABLE orders;
|
10
|
+
DROP TABLE movies;
|
11
|
+
DROP TABLE subscribers;
|
12
|
+
DROP TABLE booleantests;
|
13
|
+
DROP TABLE auto_id_tests;
|
14
|
+
DROP TABLE entrants;
|
15
|
+
DROP TABLE colnametests;
|
16
|
+
DROP TABLE mixins;
|
17
|
+
DROP TABLE people;
|
18
|
+
DROP TABLE readers;
|
19
|
+
DROP TABLE binaries;
|
20
|
+
DROP TABLE computers;
|
21
|
+
DROP TABLE tasks;
|
22
|
+
DROP TABLE posts;
|
23
|
+
DROP TABLE comments;
|
24
|
+
DROP TABLE authors;
|
25
|
+
DROP TABLE categories;
|
26
|
+
DROP TABLE categories_posts;
|
27
|
+
DROP TABLE fk_test_has_fk;
|
28
|
+
DROP TABLE fk_test_has_pk;
|
29
|
+
DROP TABLE keyboards;
|
30
|
+
DROP TABLE legacy_things;
|
31
|
+
DROP TABLE numeric_data;
|
32
|
+
DROP TABLE mixed_case_monkeys;
|
@@ -0,0 +1,215 @@
|
|
1
|
+
CREATE TABLE 'accounts' (
|
2
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
3
|
+
'firm_id' INTEGER DEFAULT NULL,
|
4
|
+
'credit_limit' INTEGER DEFAULT NULL
|
5
|
+
);
|
6
|
+
|
7
|
+
CREATE TABLE 'funny_jokes' (
|
8
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
9
|
+
'name' TEXT DEFAULT NULL
|
10
|
+
);
|
11
|
+
|
12
|
+
CREATE TABLE 'companies' (
|
13
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
14
|
+
'type' VARCHAR(255) DEFAULT NULL,
|
15
|
+
'ruby_type' VARCHAR(255) DEFAULT NULL,
|
16
|
+
'firm_id' INTEGER DEFAULT NULL,
|
17
|
+
'name' TEXT DEFAULT NULL,
|
18
|
+
'client_of' INTEGER DEFAULT NULL,
|
19
|
+
'rating' INTEGER DEFAULT 1
|
20
|
+
);
|
21
|
+
|
22
|
+
|
23
|
+
CREATE TABLE 'topics' (
|
24
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
25
|
+
'title' VARCHAR(255) DEFAULT NULL,
|
26
|
+
'author_name' VARCHAR(255) DEFAULT NULL,
|
27
|
+
'author_email_address' VARCHAR(255) DEFAULT NULL,
|
28
|
+
'written_on' DATETIME DEFAULT NULL,
|
29
|
+
'bonus_time' TIME DEFAULT NULL,
|
30
|
+
'last_read' DATE DEFAULT NULL,
|
31
|
+
'content' TEXT,
|
32
|
+
'approved' boolean DEFAULT 't',
|
33
|
+
'replies_count' INTEGER DEFAULT 0,
|
34
|
+
'parent_id' INTEGER DEFAULT NULL,
|
35
|
+
'type' VARCHAR(255) DEFAULT NULL
|
36
|
+
);
|
37
|
+
|
38
|
+
CREATE TABLE 'developers' (
|
39
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
40
|
+
'name' TEXT DEFAULT NULL,
|
41
|
+
'salary' INTEGER DEFAULT 70000,
|
42
|
+
'created_at' DATETIME DEFAULT NULL,
|
43
|
+
'updated_at' DATETIME DEFAULT NULL
|
44
|
+
);
|
45
|
+
|
46
|
+
CREATE TABLE 'projects' (
|
47
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
48
|
+
'name' TEXT DEFAULT NULL,
|
49
|
+
'type' VARCHAR(255) DEFAULT NULL
|
50
|
+
);
|
51
|
+
|
52
|
+
CREATE TABLE 'developers_projects' (
|
53
|
+
'developer_id' INTEGER NOT NULL,
|
54
|
+
'project_id' INTEGER NOT NULL,
|
55
|
+
'joined_on' DATE DEFAULT NULL,
|
56
|
+
'access_level' INTEGER DEFAULT 1
|
57
|
+
);
|
58
|
+
|
59
|
+
|
60
|
+
CREATE TABLE 'orders' (
|
61
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
62
|
+
'name' VARCHAR(255) DEFAULT NULL,
|
63
|
+
'billing_customer_id' INTEGER DEFAULT NULL,
|
64
|
+
'shipping_customer_id' INTEGER DEFAULT NULL
|
65
|
+
);
|
66
|
+
|
67
|
+
CREATE TABLE 'customers' (
|
68
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
69
|
+
'name' VARCHAR(255) DEFAULT NULL,
|
70
|
+
'balance' INTEGER DEFAULT 0,
|
71
|
+
'address_street' TEXT DEFAULT NULL,
|
72
|
+
'address_city' TEXT DEFAULT NULL,
|
73
|
+
'address_country' TEXT DEFAULT NULL,
|
74
|
+
'gps_location' TEXT DEFAULT NULL
|
75
|
+
);
|
76
|
+
|
77
|
+
CREATE TABLE 'movies' (
|
78
|
+
'movieid' INTEGER PRIMARY KEY NOT NULL,
|
79
|
+
'name' VARCHAR(255) DEFAULT NULL
|
80
|
+
);
|
81
|
+
|
82
|
+
CREATE TABLE subscribers (
|
83
|
+
'nick' VARCHAR(255) PRIMARY KEY NOT NULL,
|
84
|
+
'name' VARCHAR(255) DEFAULT NULL
|
85
|
+
);
|
86
|
+
|
87
|
+
CREATE TABLE 'booleantests' (
|
88
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
89
|
+
'value' INTEGER DEFAULT NULL
|
90
|
+
);
|
91
|
+
|
92
|
+
CREATE TABLE 'auto_id_tests' (
|
93
|
+
'auto_id' INTEGER PRIMARY KEY NOT NULL,
|
94
|
+
'value' INTEGER DEFAULT NULL
|
95
|
+
);
|
96
|
+
|
97
|
+
CREATE TABLE 'entrants' (
|
98
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
99
|
+
'name' VARCHAR(255) NOT NULL,
|
100
|
+
'course_id' INTEGER NOT NULL
|
101
|
+
);
|
102
|
+
|
103
|
+
CREATE TABLE 'colnametests' (
|
104
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
105
|
+
'references' INTEGER NOT NULL
|
106
|
+
);
|
107
|
+
|
108
|
+
CREATE TABLE 'mixins' (
|
109
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
110
|
+
'parent_id' INTEGER DEFAULT NULL,
|
111
|
+
'type' VARCHAR(40) DEFAULT NULL,
|
112
|
+
'pos' INTEGER DEFAULT NULL,
|
113
|
+
'lft' INTEGER DEFAULT NULL,
|
114
|
+
'rgt' INTEGER DEFAULT NULL,
|
115
|
+
'root_id' INTEGER DEFAULT NULL,
|
116
|
+
'created_at' DATETIME DEFAULT NULL,
|
117
|
+
'updated_at' DATETIME DEFAULT NULL
|
118
|
+
);
|
119
|
+
|
120
|
+
CREATE TABLE 'people' (
|
121
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
122
|
+
'first_name' VARCHAR(40) DEFAULT NULL,
|
123
|
+
'lock_version' INTEGER NOT NULL DEFAULT 0
|
124
|
+
);
|
125
|
+
|
126
|
+
CREATE TABLE 'readers' (
|
127
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
128
|
+
'post_id' INTEGER NOT NULL,
|
129
|
+
'person_id' INTEGER NOT NULL
|
130
|
+
);
|
131
|
+
|
132
|
+
CREATE TABLE 'binaries' (
|
133
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
134
|
+
'data' BLOB DEFAULT NULL
|
135
|
+
);
|
136
|
+
|
137
|
+
CREATE TABLE 'computers' (
|
138
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
139
|
+
'developer' INTEGER NOT NULL,
|
140
|
+
'extendedWarranty' INTEGER NOT NULL
|
141
|
+
);
|
142
|
+
|
143
|
+
CREATE TABLE 'posts' (
|
144
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
145
|
+
'author_id' INTEGER,
|
146
|
+
'title' VARCHAR(255) NOT NULL,
|
147
|
+
'type' VARCHAR(255) DEFAULT NULL,
|
148
|
+
'body' TEXT NOT NULL
|
149
|
+
);
|
150
|
+
|
151
|
+
CREATE TABLE 'comments' (
|
152
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
153
|
+
'post_id' INTEGER NOT NULL,
|
154
|
+
'type' VARCHAR(255) DEFAULT NULL,
|
155
|
+
'body' TEXT NOT NULL
|
156
|
+
);
|
157
|
+
|
158
|
+
CREATE TABLE 'authors' (
|
159
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
160
|
+
'name' VARCHAR(255) NOT NULL
|
161
|
+
);
|
162
|
+
|
163
|
+
CREATE TABLE 'tasks' (
|
164
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
165
|
+
'starting' DATETIME DEFAULT NULL,
|
166
|
+
'ending' DATETIME DEFAULT NULL
|
167
|
+
);
|
168
|
+
|
169
|
+
CREATE TABLE 'categories' (
|
170
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
171
|
+
'name' VARCHAR(255) NOT NULL,
|
172
|
+
'type' VARCHAR(255) DEFAULT NULL
|
173
|
+
);
|
174
|
+
|
175
|
+
CREATE TABLE 'categories_posts' (
|
176
|
+
'category_id' INTEGER NOT NULL,
|
177
|
+
'post_id' INTEGER NOT NULL
|
178
|
+
);
|
179
|
+
|
180
|
+
CREATE TABLE 'fk_test_has_pk' (
|
181
|
+
'id' INTEGER NOT NULL PRIMARY KEY
|
182
|
+
);
|
183
|
+
|
184
|
+
CREATE TABLE 'fk_test_has_fk' (
|
185
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
186
|
+
'fk_id' INTEGER NOT NULL,
|
187
|
+
|
188
|
+
FOREIGN KEY ('fk_id') REFERENCES 'fk_test_has_pk'('id')
|
189
|
+
);
|
190
|
+
|
191
|
+
CREATE TABLE 'keyboards' (
|
192
|
+
'key_number' INTEGER PRIMARY KEY NOT NULL,
|
193
|
+
'name' VARCHAR(255) DEFAULT NULL
|
194
|
+
);
|
195
|
+
|
196
|
+
--Altered lock_version column name.
|
197
|
+
CREATE TABLE 'legacy_things' (
|
198
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
199
|
+
'tps_report_number' INTEGER DEFAULT NULL,
|
200
|
+
'version' INTEGER NOT NULL DEFAULT 0
|
201
|
+
);
|
202
|
+
|
203
|
+
CREATE TABLE 'numeric_data' (
|
204
|
+
'id' INTEGER NOT NULL PRIMARY KEY,
|
205
|
+
'bank_balance' DECIMAL(10,2),
|
206
|
+
'big_bank_balance' DECIMAL(15,2),
|
207
|
+
'world_population' DECIMAL(10),
|
208
|
+
'my_house_population' DECIMAL(2),
|
209
|
+
'decimal_number_with_default' DECIMAL(3,2) DEFAULT 2.78
|
210
|
+
);
|
211
|
+
|
212
|
+
CREATE TABLE mixed_case_monkeys (
|
213
|
+
'monkeyID' INTEGER NOT NULL PRIMARY KEY,
|
214
|
+
'fleaCount' INTEGER
|
215
|
+
);
|