Displaying 20 results from an estimated 2000 matches similar to: "Proper Database Design For A Newbie"
2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a
hard time designing my db. This is what i have in mind, but I am not
sure if its the best approach.
user has_one inbox
user has_one outbox
inbox has_many messages
outbox has_many messages
inbox table
user_id
outbox table
user_id
messages table
box_id (refers to either inbox or outbox - how?)
from_id
to_id
2005 Dec 23
4
OO model style: inheritance
Hi everybody
I am totally new to rails and I am trying to start a
tiny project to get familiar with rails. But I already
got my first problem and I would be happy if somebody
could point me in the best and cleanest direction.
I am trying to develop a small gallery app. Since I
would like to add more features in future I am trying
to design a clean OO architecture of my models:
The base object
2005 Dec 12
2
count sql failing with unknown table....
Hey Rails People,
I''m doing my first Rails app and I''m having a newbie problem with the
count method....
Mysql::Error: #42S02Unknown table ''jobs_sectors'' in where clause: SELECT
COUNT(*) FROM jobs WHERE (jobs_sectors.sector_id = 1 )
Extracted source (around line #4):
1: <div class="sectors">
2: <ul>
3: <% for sector in @sectors
2006 Jul 04
1
LoginGenerator Problem
I am trying to make a barebones login system based on this example
(which in turn is just standard RoR login) but when I enter a user name
and password, it says the login is unsuccessful every time. I am not
sure where I am going wrong. Here is all relevent information
CREATE TABLE `users` (
`id` int(6) unsigned NOT NULL auto_increment,
`login` varchar(20) NOT NULL default
2006 Jan 10
5
Noob ActiveRecord Join Question
I''m new to rails and ruby, and after trying to get this to work
correctly for hours, I thought I''d give this forum an try.
I''ve setup a trivial project just to mess around with Rails database
naming conventions and associations.
I''ve got a table called Pets, and a table called Types.
Pets contains a list of pets, Parky the cat, Daisy the dog, etc, And
Types
2007 Aug 05
0
Newbie - Question on Parent child updating
All,
I''ve just started Rails and Ruby a week or so ago. Please forgive me
for my ignorance. I started writing a small test application to test
some of my new knowledge and have hit a wall. Would like some best
practices.
I have 3 tables, as below...
CREATE TABLE `carts` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`quantity` int(11) NOT NULL,
PRIMARY
2011 Feb 16
1
test emails did not arrive at SMTP server : after dovecot installation
Just set up postfix & it's running on my RHES 4.2 box.
Immediately after postfix is up, I test sending emails from a permitted
domain
(ahhh, on this postfix server's domain firewall, we even have a firewall
rule
which permits Tcp25 from those few sending domains' SMTP servers) using
an email client to sender_id@[IP_address_of_the_postfix_server] & the
/var/log/maillog on
2005 Mar 03
2
table lookup?
Ok, I''ve been messing with ror for a few days, but I''m stumped here.
Here are my tables.
CREATE TABLE `steps` (
`id` int(10) unsigned NOT NULL auto_increment,
`step_infos_id` int(10) unsigned NOT NULL default ''0'',
`translator_id` int(10) unsigned NOT NULL default ''0'',
`Sequence` int(11) NOT NULL default ''0'',
2010 Aug 04
1
IMAP/POP3 Proxy Redundancy
Looking over the list archives and Wiki there doesn't seem to be any
sort of built-in host redundancy with the proxy. I would prefer to use
a built in though it doesn't look like this is possible.
One of the suggestions that I found in the list archives was to write a
script which checks the health of the hosts and adjusts the MySQL table
accordingly. Has anyone done anything like
2006 Jan 12
1
Best Forum? Was: Migration doesn''t seem to preserve create_table options in schema
Hi,
is this the best forum to answer this question? Is there any better source
for information or another mailinglist to address this question to?
Cheers,
Mariano
---------- Forwarded message ----------
From: Mariano Kamp <mariano.kamp@gmail.com>
Date: Jan 8, 2006 6:24 PM
Subject: Migration doesn''t seem to preserve create_table options in schema
To: rails@lists.rubyonrails.org
2006 Jan 04
5
habtm recusive
I have a people table:
CREATE TABLE people (
id int(10) unsigned NOT NULL auto_increment,
first_name varchar(75) default NULL,
middle_name varchar(75) default NULL,
last_name varchar(75) default NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1272 ;
and a people_people table:
CREATE TABLE people_people (
person_id int(11) unsigned NOT NULL,
2006 May 04
6
Login generator ALWAYS says login unseccesfull
Hey I just ran this "ruby script/generate login loging_in" here is my
SQL:
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`user_name` varchar(80) default NULL,
`login` varchar(120) NOT NULL default '''',
`last_update` timestamp NOT NULL default ''0000-00-00 00:00:00'',
`last_attack` timestamp NOT NULL default ''0000-00-00
2007 Dec 13
16
"Tricks" for testing after_create callback???
I''ve got a model Message, which needs to send an email using action
mailer after it''s first saved in the database.
I want to pass the model to the mailer which then uses methods on the
message model to render the email.
So the natural way to do this is in an after_create callback on the
Message model.
But I can''t see an easy way to test this. Here''s my spec
2006 Jan 08
0
Migration doesn''t seem to preserve create_table options in schema
Hi,
I have the following migration (abbreviated):
class Initial < ActiveRecord::Migration
def self.up
create_table :messages, :options => ''ENGINE=MyISAM'', :force => true do
|t|
t.column :id, :integer, :null => false
t.column :external_id, :string, :null => false
t.column :recipients_count, :integer, :default => 0
2006 Jan 04
5
How do I set the default value for date fields?
I want my date fields to default to NIL or "", because the presence of a
date means something. My problem is that rails is defaulting the fields
to today''s date automatically when I create a new record through the
scaffold. I tried removing the default ''0000-00-00'' and changing NOT
NULL to NULL, but both columns get today''s date as the default
2005 Dec 11
1
how to use MySQL-backend !?
Hi,
i want to run a standalone-samba-PDC with a mysql-passdb backend and i
configured the mysql-database as required.
but how should i add/remove users ?
when i try
smbpasswd -a username
most columns in database have [NULL] values
i also tried pdbedit but it exits with "No user SID retrieved from database!"
is there another tool to add/remove users ?
is my smb.conf ok, or do i need to
2009 Feb 02
2
ActiveRecord::AssociationTypeMismatch (User(#54754560) expected, got User(#54510280))
i keep getting this AssociationTypeMismatch error. i think this could
be a bug related to ruby/rails when using mixins. heres a short
version of my code:
# user.rb
require ''friend_invitation''
require ''friendship''
class User < ActiveRecord::Base
include FriendInvitationUser, FriendshipUser
...
end
# friendship.rb
...
module FriendshipUser
def
2010 May 01
1
I need some help joining data from 3 MySQL tables, please
Hi all,
I am trying to display collective data from 3 MySQL tables:
The query I have, so far, is
SELECT c . * , COUNT( m.id ) AS `members`
FROM `jos_mls_teams` AS `c`
LEFT JOIN `jos_mls_teams_members` AS `m` ON m.teamid = c.id
RIGHT JOIN ( SELECT u.name, u.lastvisitDate FROM `jos_users` AS `u` )
ON u.id = m.userid
GROUP BY c.id
LIMIT 0 , 30
But get the following error:
#1248 - Every derived
2006 May 05
0
Login generator ALWAYS says login unsuccessfull
I''m having a similar problem running Radiant CMS. I set ROR and the
mysql database as instructed but when I try to login with the default
admin login I get the same result as Mohammed. Below is the output from
my log, which is very similar to what he is seeing, along with what I
believe is the hashed password stored in MySQL. The two values don''t
match. I don''t
2008 Feb 15
3
Destroy, dependent and performance
Hi!
This is my first post in this forum. I''m learning RoR for two weeks and
I''m very interested about how to improve this framework.
I was testing one app I''m working in and I had some problems with
destroying.
The code is simple (and maybe wrong, as I said i''m just learning!). When
you destroy a league, you send a message to all the users associated to
this