Skip to content

Conversation

@Logic-gate
Copy link
Collaborator

Before you merge, please check if the db schema is correct. I did not test it.
We should consider better error handling https://github.com/Logic-gate/facebot/blob/master/masterBot.py#L77

  • db.py create db. executed via masterbot https://github.com/Logic-gate/facebot/blob/master/masterBot.py#L69

    -DB SCHEMA:

    +------------------+
    | Tables_in_fbotDB |
    +------------------+
    | checkins         |
    | family           |
    | fbids            |
    | users            |
    +------------------+
    
    mysql> show columns from fbids;
    +---------+-------------+------+-----+---------+-------+
    | Field   | Type        | Null | Key | Default | Extra |
    +---------+-------------+------+-----+---------+-------+
    | fbids   | bigint(20)  | YES  |     | NULL    |       |
    | sent    | text        | YES  |     | NULL    |       |
    | crawled | varchar(20) | YES  |     | NULL    |       |
    +---------+-------------+------+-----+---------+-------+
    
    mysql> show columns from users;
    +----------------------+--------------+------+-----+---------+-------+
    | Field                | Type         | Null | Key | Default | Extra |
    +----------------------+--------------+------+-----+---------+-------+
    | fbid                 | bigint(20)   | YES  |     | NULL    |       |
    | profile_url          | text         | YES  |     | NULL    |       |
    | name                 | text         | YES  |     | NULL    |       |
    | contact_email        | text         | YES  |     | NULL    |       |
    | interests            | text         | YES  |     | NULL    |       |
    | birthday             | varchar(20)  | YES  |     | NULL    |       |
    | hometown_location    | text         | YES  |     | NULL    |       |
    | relationship_status  | text         | YES  |     | NULL    |       |
    | significant_other_id | text         | YES  |     | NULL    |       |
    | education            | text         | YES  |     | NULL    |       |
    | work                 | varchar(100) | YES  |     | NULL    |       |
    | sex                  | text         | YES  |     | NULL    |       |
    | devices              | varchar(100) | YES  |     | NULL    |       |
    +----------------------+--------------+------+-----+---------+-------+
    
    mysql> show columns from checkins;
    +------------+------------+------+-----+-------------------+-----------------------------+
    | Field      | Type       | Null | Key | Default           | Extra                       |
    +------------+------------+------+-----+-------------------+-----------------------------+
    | checkin_id | char(32)   | YES  |     | NULL              |                             |
    | fbid       | bigint(20) | YES  |     | NULL              |                             |
    | message    | text       | YES  |     | NULL              |                             |
    | coords     | text       | YES  |     | NULL              |                             |
    | timestamp  | timestamp  | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
    +------------+------------+------+-----+-------------------+-----------------------------+
    
    mysql> show columns from family;
    +--------------+--------------+------+-----+---------+-------+
    | Field        | Type         | Null | Key | Default | Extra |
    +--------------+--------------+------+-----+---------+-------+
    | fbid         | bigint(20)   | YES  |     | NULL    |       |
    | relative_id  | char(32)     | YES  |     | NULL    |       |
    | name         | varchar(80)  | YES  |     | NULL    |       |
    | relationship | varchar(100) | YES  |     | NULL    |       |
    +--------------+--------------+------+-----+---------+-------+
    
  • conf/info.conf. Config file to hold db info

    • host
    • user
    • password
    • dbname

    masterBot.py and db.py require it; https://github.com/Logic-gate/facebot/blob/master/masterBot.py#L55

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should have its own function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant