<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Customizing db:structure:dump]]></title>
		<link>http://railsforum.com/viewtopic.php?id=51560</link>
		<description><![CDATA[The most recent posts in Customizing db:structure:dump.]]></description>
		<lastBuildDate>Mon, 10 Dec 2012 21:57:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Customizing db:structure:dump]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=157471#p157471</link>
			<description><![CDATA[<p>I&#039;m using Rails 3.2.8 and have</p><p>config.active_record.schema_format = :sql <br />in my config/application.rb.</p><p>In an Oracle 11g database, I&#039;ve defined a table with virtual columns that depend on user-defined functions:</p><p>CREATE TABLE BAR (<br />&nbsp; ID NUMBER(19,0) NOT NULL,<br />&nbsp; STATUS NUMBER(19, 0) DEFAULT 1,<br />&nbsp; CALCULATED_STATUS NUMBER(19,0) GENERATED ALWAYS AS (MY_FUNCTION(STATUS)) VIRTUAL)</p><p>When Rake performs a db:test:clone_structure (Tasks: TOP =&gt; default =&gt; spec =&gt; db:test:clone_structure), I&#039;m hitting:</p><p>OCIError: ORA-00904: &quot;FOO&quot;.&quot;MY_FUNCTION&quot;: invalid identifier: CREATE TABLE &quot;BAR&quot; (...</p><p>I think what is happening is that db:structure:dump exports the tables before the functions so in development_structure.sql, the CREATE FUNCTION MY_FUNCTION appears after the CREATE TABLE BAR statement.</p><p>Do I have to go in and monkeypatch how db:structure:dump works?</p><p>Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (ayang)]]></author>
			<pubDate>Mon, 10 Dec 2012 21:57:04 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=157471#p157471</guid>
		</item>
	</channel>
</rss>
