Jump to content

What do you think of my database structure?


oskare100

Recommended Posts

Hello,
I'm building a download site for paid members only and I log, at least according to me, quite a lot of things. I do also have the logs spread out on several tables so I'm wondering if I maybe have a "strange" database structure that will be hard to work with.. Here is it;
[CODE]--
-- Table structure for table `downl_compl_logs`
--

CREATE TABLE `downl_compl_logs` (
  `downl_id` int(11) NOT NULL auto_increment,
  `downl_file_id` varchar(40) NOT NULL default '',
  `downl_file_fullname` varchar(30) NOT NULL default '',
  `downl_ip` varchar(30) NOT NULL default '',
  `downl_user` varchar(50) NOT NULL default '',
  `downl_refer` varchar(20) NOT NULL default '',
  `downl_status` varchar(30) NOT NULL default '',
  `downl_date` varchar(30) NOT NULL default '',
  `downl_timestamp` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`downl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `downl_fail_logs`
--

CREATE TABLE `downl_fail_logs` (
  `downl_id` int(11) NOT NULL auto_increment,
  `downl_file_id` varchar(40) NOT NULL default '',
  `downl_file_fullname` varchar(30) NOT NULL default '',
  `downl_ip` varchar(30) NOT NULL default '',
  `downl_user` varchar(50) NOT NULL default '',
  `downl_refer` varchar(20) NOT NULL default '',
  `downl_status` varchar(30) NOT NULL default '',
  `downl_date` varchar(30) NOT NULL default '',
  `downl_timestamp` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`downl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `files`
--

CREATE TABLE `files` (
  `file_id` int(11) NOT NULL auto_increment,
  `file_pack` varchar(50) NOT NULL default '',
  `file_pack_cat` varchar(50) NOT NULL default '',
  `file_cat` varchar(50) NOT NULL default '',
  `file_name` varchar(100) NOT NULL default '',
  `file_desc` text NOT NULL,
  `file_fullname` varchar(100) NOT NULL default '',
  `file_downloads` varchar(11) NOT NULL default '',
  PRIMARY KEY  (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `ip_logs`
--

CREATE TABLE `ip_logs` (
  `ip_id` int(11) NOT NULL auto_increment,
  `ip_ip` varchar(30) NOT NULL default '',
  `ip_user` varchar(50) NOT NULL default '',
  `ip_latest_date` varchar(30) NOT NULL default '',
  `ip_latest_timestamp` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`ip_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `items` (Items that a user can buy)
--

CREATE TABLE `items` (
  `item_id` int(11) NOT NULL auto_increment,
  `item_name` varchar(100) NOT NULL default '',
  `item_identifi` varchar(100) NOT NULL default '',
  `item_price` varchar(30) NOT NULL default '',
  `item_file_name` varchar(100) NOT NULL default '',
  `item_file_pack` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`item_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `login_logs`
--

CREATE TABLE `login_logs` (
  `login` int(11) NOT NULL auto_increment,
  `login_user` varchar(50) NOT NULL default '',
  `login_ip` varchar(30) NOT NULL default '',
  `login_date` varchar(30) NOT NULL default '',
  `login_timestamp` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`login`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `sales`
--

CREATE TABLE `sales` (
  `invoice_id` int(10) NOT NULL auto_increment,
  `receiver_email` varchar(60) NOT NULL default '',
  `item_name` varchar(100) NOT NULL default '',
  `item_number` varchar(18) NOT NULL default '',
  `quantity` varchar(6) NOT NULL default '',
  `payment_status` varchar(10) NOT NULL default '',
  `pending_reason` varchar(10) NOT NULL default '',
  `payment_date` varchar(25) NOT NULL default '',
  `mc_gross` varchar(20) NOT NULL default '',
  `mc_fee` varchar(20) NOT NULL default '',
  `tax` varchar(20) NOT NULL default '',
  `mc_currency` varchar(4) NOT NULL default '',
  `txn_id` varchar(20) NOT NULL default '',
  `txn_id_refund` varchar(20) NOT NULL default '',
  `txn_type` varchar(10) NOT NULL default '',
  `payment_type` varchar(10) NOT NULL default '',
  `notify_version` varchar(10) NOT NULL default '',
  `verify_sign` varchar(10) NOT NULL default '',
  `referrer_id` varchar(10) NOT NULL default '',
  `memo` varchar(255) NOT NULL default '',
  `for_auction` varchar(20) NOT NULL default '',
  `auction_buyer_id` varchar(64) NOT NULL default '',
  `auction_closing_date` varchar(21) NOT NULL default '',
  `auction_multi_item` varchar(20) NOT NULL default '',
  `account_username` varchar(50) NOT NULL default '',
  `account_password` varchar(20) NOT NULL default '',
  `received_timestamp` varchar(20) NOT NULL default '',
  `first_name` varchar(30) NOT NULL default '',
  `last_name` varchar(40) NOT NULL default '',
  `  address_street` varchar(50) NOT NULL default '',
  `address_city` varchar(30) NOT NULL default '',
  `address_state` varchar(30) NOT NULL default '',
  `address_zip` varchar(20) NOT NULL default '',
  `address_country` varchar(30) NOT NULL default '',
  `address_status` varchar(11) NOT NULL default '',
  `payer_email` varchar(60) NOT NULL default '',
  `  payer_status` varchar(10) NOT NULL default '',
  `mark_paid` varchar(20) NOT NULL default '',
  `mark_shipped` varchar(20) NOT NULL default '',
  `mark_feedback` varchar(30) NOT NULL default '',
  `feedback_received` varchar(100) NOT NULL default '',
  `feedback_left` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`invoice_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `user_perm` (the files the user has permission to download)
--

CREATE TABLE `user_perm` (
  `perm_id` int(11) NOT NULL auto_increment,
  `perm_user` varchar(50) NOT NULL default '',
  `file_pack` varchar(30) NOT NULL default '',
  `file_name` varchar(100) NOT NULL default '',
  `perm_date` varchar(30) NOT NULL default '',
  `perm_timestamp` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`perm_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `user_id` int(11) NOT NULL auto_increment,
  `username` varchar(100) NOT NULL default '',
  `password` varchar(40) NOT NULL default '',
  `payer_email` varchar(100) NOT NULL default '',
  `ebay_userid` varchar(50) NOT NULL default '',
  `num_downloads` varchar(10) NOT NULL default '',
  `num_logins` varchar(10) NOT NULL default '',
  `num_ips` varchar(30) NOT NULL default '',
  `num_purchases` varchar(10) NOT NULL default '',
  `address_street` varchar(50) NOT NULL default '',
  `address_city` varchar(30) NOT NULL default '',
  `address_state` varchar(30) NOT NULL default '',
  `address_zip` varchar(20) NOT NULL default '',
  `address_country` varchar(30) NOT NULL default '',
  `address_status` varchar(11) NOT NULL default '',
  `payer_status` varchar(10) NOT NULL default '',
  `first_name` varchar(30) NOT NULL default '',
  `last_name` varchar(40) NOT NULL default '',
  `latest_login_date` varchar(30) NOT NULL default '',
  `latest_login_timestamp` varchar(30) NOT NULL default '',
  `created_date` varchar(30) NOT NULL default '',
  `created_timestamp` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
[/CODE]

Feedback is appreciated : )

Thanks in advance,
/Oskar
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.