I have a few hundred subcats I need to upload to the categories table. I have an excel file of the tab delimited records that currently exist in the categories whcih I have scraped from the SQL dump file.
I need to clarify what I am seeing first and I am not sure what is required. It looks like some have default values but others may not.
I have a question about few of the fields and a few other related things. So here is the table as I see it in the dump file.
id,
name,
color,
topic_id,
topic_count,
created_at,
updated_at,
user_id,
topics_year,
topics_month,
topics_week,
slug,
description,
text_color,
read_restricted,
auto_close_hours,
post_count,
latest_post_id,
latest_topic_id,
"position",
parent_category_id,
posts_year,
posts_month,
posts_week,
email_in,
email_in_allow_strangers,
topics_day,
posts_day
Question one: id and topic_id, I have a feeling topic_id is the primary key? but what is ID?
Question two: created at and updated at...do these have a default value or do I need to provide one.
It looks like this: 2014-05-11 20:00:51.567719 I can create default if I need to.
position...I am not sure this field is what I think it is. I would think it is a 'sort order' field so I can see categories arranged in the way I want. But I am not so sure. I used the position field under settings in the categories lightbox window and changed things up. I exported but I saw no changes which leads me to believe this is handled in another table a reference table perhaps?
I balled things back up in that tarball gz thing and uploaded it to see the small changes I made to position. I didn't see any change which again leads me to believe that position is somewhere else.
I never used postgres and I am noting a seq table. For categories. Is postgres one of those databases like Oracle that are not designed to auto increment on ints the the tables with the primary key? If this is the case, do I need to trip that increment number on the sequence table so if I add a category manually the system doesn't barf or is the system intuitive enough to check the sequence against the highest number in the topic_id field and grab the next incremented value?
Once I know these things, I will:
- prepare my categories in excel
- then cut and paste them back into the sql dump file
- then add that SQL file back to the tarball gz
- upload the .gz file to my discourse app where it will run its process on upload.
Does this last part sound like the right approach?
Thanks,
Frank