14 |
en minúscula, separando palabras con barras bajas, y en |
en minúscula, separando palabras con barras bajas, y en |
15 |
singular. Es decir, por ejemplo, si la tabla describe la |
singular. Es decir, por ejemplo, si la tabla describe la |
16 |
estructura de los productos se llamará product_structure. |
estructura de los productos se llamará product_structure. |
17 |
|
|
18 |
|
Las tablas que se utilizan para expresar relaciones n:n llevarán |
19 |
|
su nombre en plural. |
20 |
|
|
21 |
Cuando una tabla se refiere a cosas de la empresa origen, es decir, |
Cuando una tabla se refiere a cosas de la empresa origen, es decir, |
22 |
la que está corriendo _esta_ instancia de PAPO, entonces esa tabla |
la que está corriendo _esta_ instancia de PAPO, entonces esa tabla |
23 |
es own_algo. Por ejemplo la tabla que se refiere a los documentos |
es own_algo. Por ejemplo la tabla que se refiere a los documentos |
84 |
own_entity -> entity |
own_entity -> entity |
85 |
|
|
86 |
# have we had to void this document? |
# have we had to void this document? |
87 |
is_void (char(1)) |
is_void (boolean) |
88 |
|
|
89 |
# what day was this document made? |
# what day was this document made? |
90 |
date (timestamp) |
date (timestamp) |
162 |
own_entity -> entity |
own_entity -> entity |
163 |
|
|
164 |
# Have we had to void this document for some reason? |
# Have we had to void this document for some reason? |
165 |
is_void (char(1)) |
is_void (boolean) |
166 |
|
|
167 |
# The number of this document |
# The number of this document |
168 |
number (char(30)) |
number (char(30)) |
351 |
commission -> commission |
commission -> commission |
352 |
|
|
353 |
# is this product subject to the whims of time? |
# is this product subject to the whims of time? |
354 |
is_perishable (char(1)) |
is_perishable (boolean) |
355 |
|
|
356 |
salable (char(1)) |
salable (boolean) |
357 |
|
|
358 |
# origin, i.e. where this product came from. This can be NULL in |
# origin, i.e. where this product came from. This can be NULL in |
359 |
# case we either don't know the origin, or it more complicated |
# case we either don't know the origin, or it more complicated |
391 |
name (varchar(80)) |
name (varchar(80)) |
392 |
|
|
393 |
# is this name requisite? |
# is this name requisite? |
394 |
is_required (char(1)) |
is_required (boolean) |
395 |
:history: |
:history: |
396 |
|
|
397 |
/* |
/* |
444 |
# parent can be NULL (topmost nodes) |
# parent can be NULL (topmost nodes) |
445 |
parent -> product_classification |
parent -> product_classification |
446 |
# is this a leaf? |
# is this a leaf? |
447 |
is_product (char(1)) |
is_product (boolean) |
448 |
# explain yourself! |
# explain yourself! |
449 |
description (text) |
description (text) |
450 |
:history: |
:history: |
586 |
|
|
587 |
# is this price_type active? a price_type can be inactive but be |
# is this price_type active? a price_type can be inactive but be |
588 |
# inside its dates. |
# inside its dates. |
589 |
is_active (char(1)) |
is_active (boolean) |
590 |
|
|
591 |
# what time this price_type activates |
# what time this price_type activates |
592 |
start_date (timestamp) |
start_date (timestamp) |
637 |
entity: |
entity: |
638 |
id (serial) |
id (serial) |
639 |
|
|
|
# what kind of entity this is. Not really used, since you |
|
|
# usually know what entity it is you're dealing with. |
|
|
entity_type -> entity_type |
|
640 |
|
|
641 |
# The name of the entity. This should be a table. |
# The name of the entity. This should be a table. |
642 |
name (varchar(255)) |
name (varchar(255)) |
648 |
start_time (timestamp) |
start_time (timestamp) |
649 |
|
|
650 |
# does this entity exist any more? |
# does this entity exist any more? |
651 |
is_active (char(1)) |
is_active (boolean) |
652 |
|
|
653 |
# blow your mind |
# blow your mind |
654 |
observations (text) |
observations (text) |
655 |
:history: |
:history: |
656 |
:account: |
:account: |
657 |
|
/* |
658 |
|
entity_type |
659 |
|
# the different kinds that an entity can be. |
660 |
|
*/ |
661 |
|
|
662 |
|
entity_types: |
663 |
|
id (serial) |
664 |
|
entity_type -> entity_type |
665 |
|
entity -> entity |
666 |
|
:history: |
667 |
|
|
668 |
/* |
/* |
669 |
entity_type_uid_conf |
entity_type_uid_conf |
|
|
|
670 |
|
|
671 |
*/ |
*/ |
672 |
|
|
673 |
entity_type_uid_conf: |
entity_type_uid_conf: |
674 |
id (serial) |
id (serial) |
675 |
entity_type -> entity_type |
entity_type -> entity_type |
733 |
:history: |
:history: |
734 |
|
|
735 |
/* |
/* |
736 |
address, telephone, url: attributes of entities |
address is general: address, telephone, url, whatever attributes to locate entities. |
737 |
|
the value is in address and the type in address_type as obvious |
738 |
*/ |
*/ |
739 |
|
|
740 |
address: |
address: |
741 |
id (serial) |
id (serial) |
742 |
entity -> entity |
entity -> entity |
743 |
|
address_type -> address_type |
744 |
address (varchar(255)) |
address (varchar(255)) |
745 |
|
comment (varchar(80)) |
746 |
:history: |
:history: |
747 |
|
|
748 |
telephone: |
address_type: |
|
id (serial) |
|
|
entity -> entity |
|
|
telephone (varchar(25)) |
|
|
:history: |
|
|
|
|
|
url: |
|
749 |
id (serial) |
id (serial) |
750 |
entity -> entity |
name (varchar(80)) |
|
url (text) |
|
751 |
:history: |
:history: |
752 |
|
|
753 |
/* |
/* |
761 |
entity_type: |
entity_type: |
762 |
id (serial) |
id (serial) |
763 |
name (varchar(80)) |
name (varchar(80)) |
764 |
|
parent -> entity_type |
765 |
:history: |
:history: |
766 |
|
|
767 |
/* |
/* |
775 |
id (serial) |
id (serial) |
776 |
entity_from -> entity |
entity_from -> entity |
777 |
entity_to -> entity |
entity_to -> entity |
778 |
relation_relation -> relation_type |
:history: |
779 |
:history: |
|
780 |
|
relation_types: |
781 |
|
id (serial) |
782 |
|
entity_relation -> entity_relation |
783 |
|
relation_type -> relation_type |
784 |
|
:history: |
785 |
|
|
786 |
relation_type: |
relation_type: |
787 |
id (serial) |
id (serial) |
788 |
name (varchar(255)) |
name (varchar(255)) |
789 |
:history: |
:history: |
790 |
|
|
791 |
|
/* |
792 |
|
entity categories and attributes. |
793 |
|
intended to group entities of the same categories |
794 |
|
example: |
795 |
|
category type category attribute |
796 |
|
size <------ big , |
797 |
|
|__ small |
798 |
|
|__ mid |
799 |
|
|
800 |
|
heading <------ automotive, |
801 |
|
|__ electronics |
802 |
|
*/ |
803 |
|
|
804 |
|
entity_attribute: |
805 |
|
id (serial) |
806 |
|
entity -> entity |
807 |
|
category_attribute -> category_attribute |
808 |
|
:history: |
809 |
|
|
810 |
|
category_attribute: |
811 |
|
id (serial) |
812 |
|
name (varchar(80)) |
813 |
|
category_type -> category_type |
814 |
|
:history: |
815 |
|
|
816 |
|
|
817 |
|
category_type: |
818 |
|
id (serial) |
819 |
|
name (varchar(80)) |
820 |
|
:history: |
821 |
|
|
822 |
|
category_entity_type: |
823 |
|
id (serial) |
824 |
|
entity_type -> entity_type |
825 |
|
category_type -> category_type |
826 |
|
:history: |
827 |
|
|
828 |
/* |
/* |
829 |
alien_entity |
alien_entity |
830 |
|
|
831 |
entities that are not "us". |
entities that are not "us". |
832 |
|
|
833 |
is a entity |
is a entity |
|
|
|
834 |
*/ |
*/ |
835 |
|
|
836 |
alien_entity(entity): |
alien_entity(entity): |
837 |
id (serial) |
id (serial) |
838 |
entity -> entity |
entity -> entity |
1601 |
# ITU code |
# ITU code |
1602 |
phone (integer) |
phone (integer) |
1603 |
:history: |
:history: |
1604 |
|
|
1605 |
|
|
1606 |
|
/* ERM : to manage the relatinship between entities */ |
1607 |
|
|
1608 |
|
|
1609 |
|
task: |
1610 |
|
id (serial) |
1611 |
|
name (varchar(80)) |
1612 |
|
parent -> task |
1613 |
|
task_type -> task_type |
1614 |
|
task_priority -> task_priority |
1615 |
|
task_status -> task_status |
1616 |
|
assigned_to -> entity |
1617 |
|
assigned_by -> entity |
1618 |
|
assigned_time (timestamp) |
1619 |
|
planned_start_time (timestamp) |
1620 |
|
planned_end_time (timestamp) |
1621 |
|
|
1622 |
|
task_type: |
1623 |
|
id (serial) |
1624 |
|
name (varchar(80)) |
1625 |
|
:history: |
1626 |
|
|
1627 |
|
task_priority: |
1628 |
|
id (serial) |
1629 |
|
name (varchar(80)) |
1630 |
|
:history: |
1631 |
|
|
1632 |
|
task_status: |
1633 |
|
id (serial) |
1634 |
|
name (varchar(80)) |
1635 |
|
:history: |
1636 |
|
|
1637 |
|
|
1638 |
|
|
1639 |
|
|
1640 |
|
/* former task_victims */ |
1641 |
|
|
1642 |
|
task_recipient: |
1643 |
|
task -> task |
1644 |
|
to_make_to -> entity |
1645 |
|
|
1646 |
|
erm_task: |
1647 |
|
id (serial) |
1648 |
|
task -> task |
1649 |
|
erm -> erm |
1650 |
|
|
1651 |
|
erm: |
1652 |
|
id (serial) |
1653 |
|
description (varchar(80)) |
1654 |
|
time (timestamp) |
1655 |
|
erm_type -> erm_type |
1656 |
|
made_by -> entity |
1657 |
|
|
1658 |
|
erm_type: |
1659 |
|
id (serial) |
1660 |
|
name (varchar(80)) |
1661 |
|
:history: |
1662 |
|
|
1663 |
|
erm_entity: |
1664 |
|
id (serial) |
1665 |
|
erm -> erm |
1666 |
|
made_to -> entity_types |
1667 |
|
|
1668 |
|
# apunta a entity types para poder discriminarlo por el |
1669 |
|
# tipo de entidad que se lo esta registrando |
1670 |
|
# en el caso de que la entidad tenga más de un tipo |
1671 |
|
|
1672 |
|
erm_log: |
1673 |
|
id (serial) |
1674 |
|
erm -> erm |
1675 |
|
text (text) |
1676 |
|
|
1677 |
|
erm_file: |
1678 |
|
id (serial) |
1679 |
|
erm -> erm |
1680 |
|
file -> file |
1681 |
|
|
1682 |
|
|
1683 |
|
|
1684 |
|
|
1685 |
|
|
1686 |
|
|
1687 |
|
|
1688 |
|
|