/*
  # Insert initial categories and sample data

  1. Categories
    - Insert predefined categories like history, thoughts, numismatics, spiritual, etc.

  2. Tags
    - Insert common tags

  3. Sample blog posts
    - Migrate existing content to database format
*/

-- Insert initial categories
INSERT INTO categories (name, slug, description, color) VALUES
  ('History', 'history', 'Historical insights and discoveries', '#8B4513'),
  ('Thoughts', 'thoughts', 'Personal reflections and opinions', '#4A90E2'),
  ('Numismatics', 'numismatics', 'Coin collecting and numismatic studies', '#D4AF37'),
  ('Spiritual', 'spiritual', 'Spiritual insights and reflections', '#9B59B6'),
  ('Business', 'business', 'Entrepreneurship and business insights', '#E74C3C'),
  ('Culture', 'culture', 'Cultural preservation and heritage', '#27AE60'),
  ('Education', 'education', 'Educational content and learning', '#F39C12')
ON CONFLICT (slug) DO NOTHING;

-- Insert initial tags
INSERT INTO tags (name, slug) VALUES
  ('numismatics', 'numismatics'),
  ('indian-coins', 'indian-coins'),
  ('collecting', 'collecting'),
  ('philately', 'philately'),
  ('heritage', 'heritage'),
  ('marudhar-arts', 'marudhar-arts'),
  ('auctions', 'auctions'),
  ('entrepreneurship', 'entrepreneurship'),
  ('introduction', 'introduction'),
  ('history', 'history'),
  ('business', 'business'),
  ('featured', 'featured'),
  ('cultural-preservation', 'cultural-preservation'),
  ('scholarship', 'scholarship')
ON CONFLICT (slug) DO NOTHING;

-- Insert sample blog posts (migrating from existing content)
INSERT INTO blog_posts (
  title, 
  slug, 
  description, 
  content, 
  featured_image, 
  featured, 
  published, 
  pub_date
) VALUES
(
  'Welcome to My Personal Blog',
  'welcome-to-my-blog',
  'An introduction to my journey in numismatics, philately, and cultural preservation',
  '# Welcome to My Personal Blog

Welcome to my personal blog, where I share insights from my decades-long journey in numismatics, philately, and the preservation of India''s rich cultural heritage.

## My Journey

From humble beginnings with just 10 rupees at the age of 13, taking charge of my father''s shop in Bikaner, to establishing Marudhar Arts as a premier auction house in Bangalore, this journey has been one of continuous learning and dedication to preserving our cultural legacy.

### What You''ll Find Here

In this blog, I''ll be sharing:

- **Insights on Numismatics**: Deep dives into coin collecting, historical significance, and market trends
- **Philatelic Discoveries**: Stories from the world of stamp collecting and postal history
- **Cultural Heritage**: The importance of preserving India''s rich historical artifacts
- **Entrepreneurial Lessons**: Experiences from building a successful auction house
- **Scholarly Pursuits**: Research findings and academic contributions

## Supporting Media Content

This blog supports various types of media to enhance the reading experience:

### Images
High-quality images of coins, stamps, and historical artifacts will be featured regularly.

### Audio Content
Listen to recorded interviews and discussions about numismatic topics.

### Video Content
Watch detailed examinations of rare coins and stamps.

## Looking Forward

I''m excited to share my knowledge and experiences with fellow collectors, scholars, and anyone interested in India''s cultural heritage. Each post will aim to educate, inspire, and contribute to the preservation of our shared history.

> "Knowledge and cultural preservation are not just personal pursuits, but responsibilities we owe to future generations."

Thank you for joining me on this journey. I look forward to sharing many more insights and discoveries with you.',
  'https://images.pexels.com/photos/4386467/pexels-photo-4386467.jpeg?auto=compress&cs=tinysrgb&w=1200',
  true,
  true,
  '2024-01-15'::timestamptz
),
(
  'The Fascinating History of Indian Coinage',
  'history-of-indian-coinage',
  'Explore the rich evolution of Indian coins from ancient times to modern Republic India',
  '# The Fascinating History of Indian Coinage

Indian coinage represents one of the world''s most diverse and historically rich numismatic traditions. From the earliest punch-marked coins of the 6th century BCE to the modern commemorative issues of the Republic of India, each coin tells a story of our nation''s remarkable journey.

## Ancient Beginnings

The story of Indian coinage begins with the **punch-marked coins** (Karshapana) around 600 BCE. These silver pieces, marked with various symbols, were among the earliest coins in the Indian subcontinent.

### Key Features of Ancient Indian Coins:
- **Material**: Primarily silver, with some copper and gold pieces
- **Weight Standards**: Based on the traditional Indian weight system
- **Symbols**: Religious and royal symbols indicating authority
- **Distribution**: Found across the Indian subcontinent

## Medieval Period

The medieval period saw significant developments in Indian coinage:

### Indo-Islamic Coinage
With the arrival of Islamic rulers, Indian coinage underwent dramatic changes:
- Introduction of **Arabic inscriptions**
- **Calligraphic designs** replacing pictorial representations
- Standardization of weight and purity

### Regional Kingdoms
Various regional kingdoms developed their unique coinage systems:
- **Vijayanagara Empire**: Known for their distinctive gold coins
- **Bahmani Sultanate**: Innovative silver and copper coins
- **Mughal Empire**: Sophisticated coinage system with artistic excellence

## British Colonial Period

The British period brought significant standardization:

### East India Company Coins
- Introduction of **European-style coinage**
- Standardized denominations
- Company symbols and British royal portraits

### British Crown Period
- Uniform coinage across British India
- Introduction of the **Rupee system**
- Distinctive designs featuring British monarchs

## Independent India

The transition to independence marked a new era in Indian numismatics:

### Republic India Coinage
Since 1950, Indian coinage has featured:
- **National symbols**: Lion Capital of Ashoka
- **Cultural themes**: Ancient art and architecture
- **Commemorative issues**: Celebrating national heroes and events
- **Modern technology**: Advanced security features

## Collecting Indian Coins

For numismatists interested in Indian coinage, here are key collecting areas:

### Popular Collecting Themes:
1. **Mughal Coins**: Artistic masterpieces with historical significance
2. **British India**: Complete colonial period collection
3. **Princely States**: Diverse and colorful regional issues
4. **Republic India**: Modern commemoratives and regular issues

### Investment Potential
Indian coins have shown excellent appreciation:
- **Rare Mughal coins**: Consistent price growth
- **Error coins**: Highly sought after by collectors
- **Commemorative silver**: Limited mintage appeal

## Notable Auction Results

At Marudhar Arts, we''ve witnessed remarkable results for Indian coins:
- Ancient punch-marked coins reaching significant premiums
- Mughal gold coins breaking auction records
- Rare British India patterns commanding high prices

## Preservation and Research

Our commitment to preserving Indian numismatic heritage includes:

### Research Publications
- Comprehensive catalogues of Indian coinage
- Historical research on mint operations
- Collaboration with international institutions

### Educational Initiatives
- National Numismatic Exhibitions
- Workshops for new collectors
- Academic partnerships with universities

## The Future of Indian Numismatics

The field continues to evolve with:
- **Digital cataloguing** of collections
- **Online auctions** making coins accessible globally
- **Academic research** uncovering new historical insights
- **Growing collector base** both domestic and international

## Conclusion

Indian coinage represents not just monetary history, but the story of our civilization itself. Each coin carries within it the dreams, aspirations, and achievements of the people who created and used it.

As we continue to study and preserve these metallic documents of history, we ensure that future generations can appreciate the rich numismatic heritage that is uniquely Indian.

---

*For more insights into Indian numismatics and information about our upcoming auctions at Marudhar Arts, stay connected with our blog.*

> "Every coin is a historical document waiting to tell its story to those who take the time to listen."',
  'https://images.pexels.com/photos/315658/pexels-photo-315658.jpeg?auto=compress&cs=tinysrgb&w=1200',
  true,
  true,
  '2024-01-20'::timestamptz
),
(
  'The Marudhar Arts Journey: Building India''s Premier Auction House',
  'marudhar-arts-journey',
  'The story behind establishing Marudhar Arts and revolutionizing the numismatic auction industry in India',
  '# The Marudhar Arts Journey: Building India''s Premier Auction House

The establishment of Marudhar Arts in 2007 marked a pivotal moment in Indian numismatics and philately. What began as a vision to create a world-class auction house has evolved into a trusted global platform for collectors and scholars alike.

## The Genesis

When my family relocated to Bangalore in 2006-2007, leaving behind our ancestral businesses in Bikaner, it was driven by two primary motivations:
- Providing better educational opportunities for our children
- Creating a modern platform for numismatic and philatelic auctions

### Early Challenges
Starting an auction house in India faced several obstacles:
- **Limited awareness** of professional auction standards
- **Trust issues** in the collector community
- **Lack of standardized grading** systems
- **International competition** from established houses

## Revolutionary Milestones

### Asia''s First Live Electronic Auction (2011)
We pioneered the first live electronic auction in Asia for numismatics and philately, which revolutionized the field by:
- Making auctions **accessible worldwide**
- Ensuring **transparent bidding** processes
- Reducing **geographical barriers** for collectors
- Creating **detailed digital catalogues**

### National Numismatic Exhibitions
Since 2011, we''ve organized 15 National Numismatic Exhibitions, creating:
- **Networking opportunities** for collectors
- **Educational platforms** for new enthusiasts
- **Research venues** for scholars
- **Market development** initiatives

## Building Trust Through Excellence

### Authentication Standards
We established rigorous authentication processes:
- **Expert evaluation** committees
- **Detailed cataloguing** with high-resolution photography
- **Provenance documentation** where available
- **Condition reports** following international standards

### Global Partnerships
Our collaborations include:
- **Krause Publications, USA**: For landmark numismatic publications
- **International collectors**: Building a global network
- **Museums and institutions**: For research and exhibitions
- **Academic institutions**: Supporting numismatic education

## Technological Innovation

### Digital Transformation
We embraced technology early:
- **Online bidding platforms** before they became mainstream
- **Digital catalogues** with detailed imagery
- **Live streaming** of auctions globally
- **Mobile-friendly** interfaces for modern collectors

### International Reach
Our auctions now attract participants from:
- **United States and Canada**
- **European Union countries**
- **Australia and New Zealand**
- **Southeast Asian nations**
- **Middle Eastern countries**

## Community Impact

### Educational Initiatives
- **Collector workshops** for beginners
- **Expert seminars** on specialized topics
- **Student programs** with universities
- **Research grants** through the Prem Ratan Fellowship

### Market Development
- **Price discovery** for Indian numismatics
- **Market standardization** through consistent grading
- **International exposure** for Indian collectors
- **Investment awareness** in collectibles

## Notable Achievements

### Record-Breaking Sales
- Ancient Indian coins achieving international recognition
- Mughal numismatics setting new benchmarks
- British India rarities commanding premium prices
- Modern Indian errors creating collector interest

### Publication Milestones
- **2013**: "South Asian Coins and Paper Money - India"
- **2014**: World Coin Catalogue revision (1701-1800)
- **2022**: IBNS Book of the Year Award winner

## Challenges and Solutions

### Market Education
**Challenge**: Limited understanding of auction processes
**Solution**: Regular educational content and transparent practices

### Authentication Concerns
**Challenge**: Fake and altered items in the market
**Solution**: Stringent authentication protocols and expert committees

### International Competition
**Challenge**: Competing with established global auction houses
**Solution**: Specialization in Indian material and superior customer service

## The Team Behind Success

### Core Values
- **Integrity** in all dealings
- **Expertise** in cataloguing and authentication
- **Innovation** in technology and processes
- **Education** as a community service

### Family Collaboration
The involvement of my son Archie, with his Master''s degree in Archaeology and Numismatics, has brought:
- **Academic rigor** to our publications
- **Fresh perspectives** on market trends
- **International connections** through his education
- **Continuity** for future generations

## Future Vision

### Expansion Plans
- **Museum establishment** in Bangalore
- **Online heritage platform** for global access
- **Educational partnerships** with more institutions
- **Technology integration** including AI for cataloguing

### Global Ambitions
- **International auction venues** beyond India
- **Collaborative exhibitions** with world museums
- **Research publications** in multiple languages
- **Digital preservation** of numismatic heritage

## Lessons Learned

### Business Insights
1. **Trust is paramount** in the auction business
2. **Education drives market growth**
3. **Technology enhances but doesn''t replace expertise**
4. **International perspective is essential**
5. **Community service builds lasting relationships**

### Personal Growth
The Marudhar Arts journey has been transformative:
- From local dealer to international auction house
- From family business to institutional platform
- From individual pursuit to community service
- From profit focus to heritage preservation

## Recognition and Awards

### Industry Acknowledgment
- **Karnataka Numismatic Society**: Elected President (2022)
- **International Bank Note Society**: India Chapter Treasurer
- **Global collector network**: Trusted partner status
- **Academic institutions**: Research collaboration partner

## Conclusion

The Marudhar Arts journey reflects the broader evolution of Indian numismatics from a niche hobby to a sophisticated collecting field with international recognition. What started as an entrepreneurial venture has become a platform for cultural preservation and academic research.

As we look toward the future, our commitment remains unchanged: to serve the global numismatic community with integrity, expertise, and innovation while preserving India''s rich cultural heritage for future generations.

---

*The story of Marudhar Arts continues to unfold with each auction, each discovery, and each new collector we welcome into this fascinating world of numismatics and philately.*

> "Success in business is not just about profit, but about the positive impact we create in our community and the legacy we leave for future generations."',
  'https://images.pexels.com/photos/6863183/pexels-photo-6863183.jpeg?auto=compress&cs=tinysrgb&w=1200',
  false,
  true,
  '2024-01-25'::timestamptz
)
ON CONFLICT (slug) DO NOTHING;

-- Link posts to categories
DO $$
DECLARE
  welcome_post_id uuid;
  history_post_id uuid;
  journey_post_id uuid;
  thoughts_cat_id uuid;
  history_cat_id uuid;
  numismatics_cat_id uuid;
  business_cat_id uuid;
  culture_cat_id uuid;
BEGIN
  -- Get post IDs
  SELECT id INTO welcome_post_id FROM blog_posts WHERE slug = 'welcome-to-my-blog';
  SELECT id INTO history_post_id FROM blog_posts WHERE slug = 'history-of-indian-coinage';
  SELECT id INTO journey_post_id FROM blog_posts WHERE slug = 'marudhar-arts-journey';
  
  -- Get category IDs
  SELECT id INTO thoughts_cat_id FROM categories WHERE slug = 'thoughts';
  SELECT id INTO history_cat_id FROM categories WHERE slug = 'history';
  SELECT id INTO numismatics_cat_id FROM categories WHERE slug = 'numismatics';
  SELECT id INTO business_cat_id FROM categories WHERE slug = 'business';
  SELECT id INTO culture_cat_id FROM categories WHERE slug = 'culture';
  
  -- Link posts to categories
  INSERT INTO post_categories (post_id, category_id) VALUES
    (welcome_post_id, thoughts_cat_id),
    (welcome_post_id, culture_cat_id),
    (history_post_id, history_cat_id),
    (history_post_id, numismatics_cat_id),
    (journey_post_id, business_cat_id),
    (journey_post_id, numismatics_cat_id)
  ON CONFLICT (post_id, category_id) DO NOTHING;
END $$;

-- Link posts to tags
DO $$
DECLARE
  welcome_post_id uuid;
  history_post_id uuid;
  journey_post_id uuid;
  intro_tag_id uuid;
  numismatics_tag_id uuid;
  heritage_tag_id uuid;
  history_tag_id uuid;
  collecting_tag_id uuid;
  featured_tag_id uuid;
  marudhar_tag_id uuid;
  auctions_tag_id uuid;
  entrepreneurship_tag_id uuid;
  business_tag_id uuid;
BEGIN
  -- Get post IDs
  SELECT id INTO welcome_post_id FROM blog_posts WHERE slug = 'welcome-to-my-blog';
  SELECT id INTO history_post_id FROM blog_posts WHERE slug = 'history-of-indian-coinage';
  SELECT id INTO journey_post_id FROM blog_posts WHERE slug = 'marudhar-arts-journey';
  
  -- Get tag IDs
  SELECT id INTO intro_tag_id FROM tags WHERE slug = 'introduction';
  SELECT id INTO numismatics_tag_id FROM tags WHERE slug = 'numismatics';
  SELECT id INTO heritage_tag_id FROM tags WHERE slug = 'heritage';
  SELECT id INTO history_tag_id FROM tags WHERE slug = 'history';
  SELECT id INTO collecting_tag_id FROM tags WHERE slug = 'collecting';
  SELECT id INTO featured_tag_id FROM tags WHERE slug = 'featured';
  SELECT id INTO marudhar_tag_id FROM tags WHERE slug = 'marudhar-arts';
  SELECT id INTO auctions_tag_id FROM tags WHERE slug = 'auctions';
  SELECT id INTO entrepreneurship_tag_id FROM tags WHERE slug = 'entrepreneurship';
  SELECT id INTO business_tag_id FROM tags WHERE slug = 'business';
  
  -- Link posts to tags
  INSERT INTO post_tags (post_id, tag_id) VALUES
    (welcome_post_id, intro_tag_id),
    (welcome_post_id, numismatics_tag_id),
    (welcome_post_id, heritage_tag_id),
    (welcome_post_id, featured_tag_id),
    (history_post_id, numismatics_tag_id),
    (history_post_id, history_tag_id),
    (history_post_id, collecting_tag_id),
    (history_post_id, featured_tag_id),
    (journey_post_id, marudhar_tag_id),
    (journey_post_id, auctions_tag_id),
    (journey_post_id, entrepreneurship_tag_id),
    (journey_post_id, business_tag_id)
  ON CONFLICT (post_id, tag_id) DO NOTHING;
END $$;